Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The behavior of post_permalink filter is strange #5575

Open
2 tasks done
yqs112358 opened this issue Nov 21, 2024 · 0 comments
Open
2 tasks done

The behavior of post_permalink filter is strange #5575

yqs112358 opened this issue Nov 21, 2024 · 0 comments

Comments

@yqs112358
Copy link

yqs112358 commented Nov 21, 2024

Check List

  • I have already read Docs page.
  • I have already searched existing issues.

Feature Request

According to builtin plugin https://github.com/hexojs/hexo/blob/master/lib/plugins/filter/post_permalink.ts, it's a plugin that inputs data object but returns the permalink string, and its priority is 10 in default.

So, when developing a plugin that registered on post_permalink, if the priority of filter is between 1-10, it will get a data object as its first argument, with no permalink set . But it will get a permalink string instead of data object when the filter's priority is larger than 10.

This design can sometimes be disturbing: different priority value can lead to different parameter contents. I think it's better to make this clear in the documentation. Or, better yet, redesign this API to separate post-permalink and after-permalink hook positions explicitly.

Others

No response

@yqs112358 yqs112358 changed the title The behavior of post_permalink filter is strange, should be mentioned in the docs. The behavior of post_permalink filter is strange Nov 21, 2024
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

No branches or pull requests

1 participant