Restore legacy permalink behavior using :filepath
pattern
#5661
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does it do?
This PR introduces or adjusts the
:filepath
permalink pattern to replicate the previous behavior of:title
, which was based on the post's file name and path undersource/_posts/
.✅ What this PR does:
:filepath
🧪 How to test:
_config.yml
:source/_posts/
generate the expected permalinks matching the file name.📌 Related Issue / Discussion:
Original issue and discussion
Issue describing permalink regression
🙏 Note:
This change helps long-time users maintain their blog structure and avoid unnecessary mass edits due to the breaking permalink change. Especially for blogger/wordpress users who have migrated to Hexo.
🔍 Test Results:
Dev repo (Hexo fork):
https://github.com/dimaslanjaka/hexo/tree/603a01549d895b60994e7b455574c5c915b4e35c
Test unit repo:
https://github.com/dimaslanjaka/hexo-theme-unit-test/tree/monorepo
Test result output (gh-pages):
https://github.com/dimaslanjaka/hexo-theme-unit-test/tree/gh-pages
Live site preview:
https://www.webmanajemen.com/hexo-theme-unit-test/
All posts render with the expected permalink structure using the
:filepath
pattern.Screenshots
Pull request tasks