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

Shortcode TOC - when a Heading is also a link that link is used in the TOC #1

Open
thetwopct opened this issue Aug 17, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@thetwopct
Copy link
Collaborator

When a header is a link and is then in the Table of Contents shortcode the link is shown in the TOC instead of the anchor to it.

@thetwopct thetwopct self-assigned this Aug 17, 2023
@thetwopct thetwopct removed their assignment Sep 17, 2023
@thetwopct thetwopct added the bug Something isn't working label Sep 17, 2023
@cjyabraham cjyabraham self-assigned this Dec 1, 2023
@cjyabraham
Copy link
Contributor

cjyabraham commented Dec 29, 2023

What the Hugo TableOfContents var produces is two nested anchor tags:

<a href="#header-as-a-linkhttpswwwcncfio"><a href="https://www.cncf.io">Header as a link</a></a>

So the bug is in Hugo itself.

I wonder, however, why we encourage having headers which are also links? I don't see this as a useful content style since headings are usually used to introduce content directly below them, not link out to some other location. Perhaps we just leave the "bug" for now and remove "headings as a link" from our example site?

@cjyabraham cjyabraham removed their assignment Dec 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants