Skip to content

[Question] Generate fixed anchors from title #1227

Answered by jakeminusone
deanwong asked this question in General
Discussion options

You must be logged in to vote

Hi @deanwong

You can generate fixed anchors by using the following notation in your markdown source files:

Before:
<h2 id='my-fixed-anchor'>Old Title</h2>

After:
<h2 id='my-fixed-anchor'>New Title</h2>

The title will be updated in your static html site, but the anchor will remain fixed. My team is regularly using this notation to create a standard pattern for anchors in each section of our docs. This also allows headings with the same title to be linked by different anchors. For example:

<h3 id='query-instructions'>Instructions</h3>
<h3 id='setup-instructions'>Instructions</h3>

@abourget, I believe you had the same question posted to the old Slate API Docs community page:
https://spectrum…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@deanwong
Comment options

@jakeminusone
Comment options

@deanwong
Comment options

Answer selected by deanwong
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1227 on May 20, 2020 21:55.