Open D-Sketon opened 10 months ago
Please check followings before submitting a new issue.
hexo version
register new tag function
hexo.extend.tag.register("series",() => { console.log(hexo.locals.get('posts').length) },{ends: false});
create three posts like this:
--- title: test1 date: 2023-09-03 16:59:42 tags: tag1 --- {% series %}
--- title: test2 date: 2023-09-03 16:59:46 tags: tag1 ---
--- title: test3 date: 2023-09-03 16:59:49 tags: tag1 ---
hexo g and the output result is 2
hexo g
However, if all tags in the post are removed, the result is 3
Node.js & npm version(node -v && npm -v)
node -v && npm -v
v18.12.1 8.19.2
Your site _config.yml (Optional)
_config.yml
Hexo and Plugin version(npm ls --depth 0)
npm ls --depth 0
Your package.json package.json
package.json
{ "name": "hexo-site", "version": "0.0.0", "private": true, "scripts": { "build": "hexo generate", "clean": "hexo clean", "deploy": "hexo deploy", "server": "hexo server" }, "hexo": { "version": "6.3.0" }, "dependencies": { "hexo": "^6.3.0", "hexo-generator-archive": "^2.0.0", "hexo-generator-category": "^2.0.0", "hexo-generator-index": "^3.0.0", "hexo-generator-tag": "^2.0.0", "hexo-renderer-ejs": "^2.0.0", "hexo-renderer-marked": "^6.0.0", "hexo-renderer-stylus": "^3.0.0", "hexo-server": "^3.0.0", "hexo-theme-landscape": "^1.0.0" } }
~i make a test and it works well~
hexojs#5194(comment)
I also had this problem and it was weird
I try to remove cache here and it works. https://github.com/hexojs/hexo/blob/bc53720dd9fa7e11cc3b34c67fe95692aa085e28/lib/hexo/locals.ts#L15-L20 But I don't think that's where the problem lies.
Check List
Please check followings before submitting a new issue.
hexo version
to check)Expected behavior
Actual behavior
5286 #5194 #5230
How to reproduce?
register new tag function
create three posts like this:
hexo g
and the output result is 2However, if all tags in the post are removed, the result is 3
Is the problem still there under "Safe mode"?
Environment & Settings
Node.js & npm version(
node -v && npm -v
)Your site
_config.yml
(Optional)Hexo and Plugin version(
npm ls --depth 0
)Your package.json
package.json
Others