Skip to content

fix: reprocess future posts after publish date#5782

Open
puneetdixit200 wants to merge 1 commit into
hexojs:masterfrom
puneetdixit200:fix-future-post-cache-relations
Open

fix: reprocess future posts after publish date#5782
puneetdixit200 wants to merge 1 commit into
hexojs:masterfrom
puneetdixit200:fix-future-post-cache-relations

Conversation

@puneetdixit200

Copy link
Copy Markdown

What does it do?

Fixes #5642.

When future: false hides a future-dated post, Hexo strips its tag/category relations while processing. The source cache was still saved as clean, so once the post date passed, a later hexo generate could skip the unchanged source file and leave tag/category pages missing until the post changed or the site was cleaned.

This keeps published future-dated posts dirty in the source cache while future: false, so the next generate after their publish date reprocesses the post and restores its relations.

Screenshots

N/A

Pull request tasks

  • Add test cases for the changes.
  • Passed the CI test.

Local verification:

  • TS_NODE_CACHE=false npm_config_cache=/tmp/hexo-5671-npm-cache npx mocha test/scripts/console/generate.ts --require ts-node/register --grep "reprocesses future posts" --timeout 60000
  • TS_NODE_CACHE=false npm_config_cache=/tmp/hexo-5671-npm-cache npx mocha test/scripts/processors/post.ts --require ts-node/register --timeout 60000
  • npm_config_cache=/tmp/hexo-5671-npm-cache npm run build
  • npm_config_cache=/tmp/hexo-5671-npm-cache npx eslint lib/plugins/processor/post.ts test/scripts/console/generate.ts
  • npm_config_cache=/tmp/hexo-5671-npm-cache npm run eslint
  • git diff --check

@github-actions

github-actions Bot commented Jun 4, 2026

Copy link
Copy Markdown

How to test

git clone -b fix-future-post-cache-relations https://github.com/puneetdixit200/hexo.git
cd hexo
npm install
npm test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

future: false not generating properly categories and tag pages

1 participant