#5575·hexo

The behavior of `post_permalink` filter is strange

Author: yqs112358Created Nov 21, 2024Updated Aug 8, 2026

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