Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore heading self links #2007

Merged
merged 3 commits into from
Nov 29, 2024
Merged

Conversation

zecakeh
Copy link
Contributor

@zecakeh zecakeh commented Nov 20, 2024

It was a change I did not notice when upgrading Docsy from 0.8.0 to 0.11.0 in #1996. Docsy changed the way heading self links are generated: they used to be rendered with JS and now they use a Hugo render hook.

This means two things:

  • We need to enable them explicitly for headings rendered by Hugo by overriding the _default/_markup/render-heading.html template.
  • We need to add the self heading ourselves to headings that are not rendered by Hugo, i.e. HTML headings that we create ourselves.

Note that now the symbol for the self links is # by default instead of a chain link icon. We can change it if preferred.

image

Pull Request Checklist

Preview: https://pr2007--matrix-spec-previews.netlify.app

It was a change I did not notice when upgrading Docsy from 0.8.0 to 0.11.0. Docsy changed the way heading self links are generated: they used to be rendered with JS and now they use a Hugo render hook.

This means two things:
- We need to enable them explicitly by overriding the `_default/_markup/render-heading.html` template.
- We need to add the self heading ourselves to headings that are not rendered by Hugo, i.e. HTML headings that we create ourselves.

Signed-off-by: Kévin Commaille <[email protected]>
@zecakeh zecakeh requested a review from a team as a code owner November 20, 2024 09:45
@richvdh richvdh added the release-blocker Blocks the next release from happening label Nov 26, 2024
Signed-off-by: Kévin Commaille <[email protected]>
@zecakeh zecakeh requested a review from richvdh November 28, 2024 14:10
Copy link
Member

@richvdh richvdh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@richvdh richvdh merged commit 7ec9b7f into matrix-org:main Nov 29, 2024
12 checks passed
@zecakeh zecakeh deleted the heading-self-link branch November 29, 2024 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-blocker Blocks the next release from happening
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants