Skip to content

url_for tag plugin #4749

@noraj

Description

@noraj

Check List

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

Feature Request

Add a tag plugin for url_for (and full_url_for) helper.

Existing tags plugins

Surprisingly there are post_path and post_link that works only for posts in the source/_posts/ folder and asset_path and asset_link for assets in the post_asset_folder but there is nothing for pages or something more generic.

Issue

So if you wan to refer to source/docs/b.md from source/docs/a.md you can use a classic abosulute link eg. [b](/docs/b) or [b](/docs/b.html) or a classic relative link [b](docs/b).

Classic absolute links won't work when you have a root: /root/ prefix in _config.yml because your link will be /docs/b.html instead of /root/docs/b.html, and relative links won't work if you are not at the root, eg. if you are at /root/docs/ your link will be /root/docs/docs/b.html. That's why url_for and `full_url_for were created in the first place, but they are not available from content.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions