Skip to content

Restore legacy permalink behavior using :filepath pattern - #5847

Open
dimaslanjaka wants to merge 2 commits into
hexojs:masterfrom
dimaslanjaka:filepath-permalink
Open

dimaslanjaka wants to merge 2 commits into
hexojs:masterfrom
dimaslanjaka:filepath-permalink

Conversation

@dimaslanjaka

Copy link
Copy Markdown
Contributor

What does it do?

This PR restores legacy permalink behavior using the :filepath pattern, resolving the regression described in #5658.

This is a replacement for the previous PR #5661. I have addressed the feedback provided by @stevenjoezhang in this comment:

  • Fixed test imports to use relative paths instead of package name.
  • Updated implementation to use data.source to properly handle custom source_dir configurations.
  • Added handling for _drafts/ folders to ensure permalinks remain consistent after publication.

Fixes #5658

Screenshots

N/A (Logic change)

Pull request tasks

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

@github-actions

Copy link
Copy Markdown

How to test

git clone -b filepath-permalink https://github.com/dimaslanjaka/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.

permalink :title changed without backward-compatible replacement

1 participant