Skip to content

Conversation

@bep
Copy link
Member

@bep bep commented Feb 16, 2025

Fixes #13403

@bep bep force-pushed the feat/dlautoid branch 5 times, most recently from fcfaa8f to 0a6878f Compare February 16, 2025 15:17
@bep bep marked this pull request as ready for review February 16, 2025 15:18
@bep bep changed the title Add autoID for decription terms Feb 16, 2025
@bep bep changed the title Add autoID for description terms Feb 16, 2025
@bep bep force-pushed the feat/dlautoid branch 3 times, most recently from 2a6d797 to 412bdd6 Compare February 16, 2025 17:11
@bep bep requested a review from jmooring February 16, 2025 17:46
Copy link
Member

@jmooring jmooring left a comment

Choose a reason for hiding this comment

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

I'll take this for a spin in a bit.

@jmooring
Copy link
Member

Something to think about for the docs site... since we don't have a dt render hook, should we use something like https://github.com/bryanbraun/anchorjs to render anchors for both headings and dt elements?

@bep
Copy link
Member Author

bep commented Feb 16, 2025

should we use something like https://github.com/bryanbraun/anchorjs to render anchors for both headings and dt elements?

No. If we want to do this via JS it can be easily be done in "five lines" in a AlpineJS controller.

@jmooring
Copy link
Member

This is very slick. Works great with the link render hook on the docs site (e.g., validate id existence and check for duplicates).

And thanks for this too:

A [link](/a/b) in the heading --> id becomes "a-link-in-the-heading"
: something
@jmooring
Copy link
Member

If we want to do this via JS

I have no preference how we do it... this is the last task in eliminating the h6 hack.

Fixes gohugoio#13403
See gohugoio#11566

Co-authored-by: Joe Mooring <joe@mooring.com>
@bep
Copy link
Member Author

bep commented Feb 16, 2025

I have no preference how we do it... this is the last task in eliminating the h6 hack.

I added a fix for this in gohugoio/hugoDocs#2914

I like definition lists for documentation and making them as easy to use as possible (by making them easy to link to) is worth it, I guess, so I suggest we go with the approach above. It's simple enough.

@bep bep merged commit 157d370 into gohugoio:master Feb 16, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants