Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

~/source/_data/footer.swig can't work as well #1727

Open
chjiyun opened this issue Apr 21, 2023 · 1 comment
Open

~/source/_data/footer.swig can't work as well #1727

chjiyun opened this issue Apr 21, 2023 · 1 comment
Labels

Comments

@chjiyun
Copy link

chjiyun commented Apr 21, 2023

Expected behavior

打算自定义footer

Actual behavior

本地启动 后控制台报错

ERROR Process failed: _data/footer.swig
Template render error: (E:\hexo-blog\source\_data\footer.swig) [Line 13, Column 30]
  Error: Unable to call `date`, which is undefined or falsey
    at Hexo.njkRenderer (E:\hexo-blog\themes\next-new\scripts\renderer.js:24:27)
    at E:\hexo-blog\node_modules\hexo\lib\hexo\render.js:81:22
    at _drainQueue (E:\hexo-blog\node_modules\bluebird\js\release\async.js:86:9)
    at Async._drainQueues (E:\hexo-blog\node_modules\bluebird\js\release\async.js:102:5)
    at Immediate.Async.drainQueues [as _onImmediate] (E:\hexo-blog\node_modules\bluebird\js\release\async.js:15:14)
    at processImmediate (internal/timers.js:464:21)

Steps to reproduce the behavior

  1. 复制主题目录下的footer.swig 到 ~/source/_data
  2. hexo s

Environment Information

hexo-theme-next v7.8.0

Node.js and NPM Information

node -v
v14.21.3
npm -v
9.6.4

Package dependencies Information

Hexo Configuration

NexT Configuration

custom_file_path:
  postMeta: source/_data/post-meta.swig
  footer: source/_data/footer.swig
  bodyEnd: source/_data/body-end.swig
  style: source/_data/styles.styl

只加了footer的路径配置,关闭footer 也是报错,只要粘贴footer文件过来就报错

@chjiyun chjiyun added the Bug label Apr 21, 2023
@welcome
Copy link

welcome bot commented Apr 21, 2023

Thanks for opening this issue, maintainers will get back to you as soon as possible!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant