You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Typical behaviour for anchor links are to act as permalinks to a heading on a page. Currently the links generated are relative to the current page, which may or may not be the permalink page for that entry. So it would be great if there was an optional parameter on the |anchors filter for specifying the base URL which can be prepended to all generated anchor links.
<!-- current behavior --><aclass="anchor" href="#foo-bar" …>
#
</a><!-- with a new base URL param --><aclass="anchor" href="https://example.com/blog/2023/entry-permalink#foo-bar" …>
#
</a>
Steps to reproduce
Create a blog index page and show the latest 5 entries on that page.
For each blog teaser on the index page, show the full post text, generate anchor links on the headings in the post.
The generated link for all headings will be relative to the blog index page, not the blog entry’s permalink page. So the links will stop working once the current posts are replaced with newer posts in the index.
This discussion was converted from issue #27 on March 15, 2024 11:17.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Description
Typical behaviour for anchor links are to act as permalinks to a heading on a page. Currently the links generated are relative to the current page, which may or may not be the permalink page for that entry. So it would be great if there was an optional parameter on the
|anchors
filter for specifying the base URL which can be prepended to all generated anchor links.Steps to reproduce
Additional info
Beta Was this translation helpful? Give feedback.
All reactions