8000 The behavior of `post_permalink` filter is strange · Issue #5575 · hexojs/hexo · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
The behavior of post_permalink filter is strange #5575
Open
@yqs112358

Description

@yqs112358

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0