Open lotabout opened 2 months ago
j2 becomes html and loses the content field? (Is this normal behaviour?)
And #5121's modification resulted in an undefined exception:
https://github.com/hexojs/hexo/blob/093dc2d1c92dd7fdea74bb1ccc2208556316e2a6/lib/plugins/tag/include_code.ts#L57-L58
I think setting code_dir
to skip render should solve the problem. This should be feasible during the loading process in Hexo.
The current situation is more complicated than I thought. Hexo's current database models Page
and Asset
are not well-suited for expressing "code" files (including not only j2
but also js
or css
files):
Assets
are not rendered, but their content is also not stored in the database (usually used for handling multimedia resources like images, but not plain text files);Pages
are always rendered, even if they are non-markdown files such as the aforementioned j2
, js
, or css
. Typically, users do not want these files to be rendered as pages or converted to other formats (though there are exceptions, such as plugins used for compressing js files).I have not found a very elegant solution about how to handle files in code_dir
.
This may be related to version. v7.1.1 does not have this problem
#5121's modification resulted in an undefined exception: https://github.com/hexojs/hexo/blob/093dc2d1c92dd7fdea74bb1ccc2208556316e2a6/lib/plugins/tag/include_code.ts#L57-L58
I guess that's a problem but not a critical one. code_dir itself should not be rendered
Check List
hexo version
to check)Expected behavior
.j2
files incode_dir
folder should not breakshexo generate
Actual behavior
hexo generate
will fail. (see the reproducing steps)How to reproduce?
Gives the following error:
Is the problem still there under
Safe mode
?no
Your Node.js & npm version
Your Hexo and Plugin version
Your
package.json
Your site's
_config.yml
(Optional)No response
Others
No response