Hm... you'd think there is a plugin for that already, but apparently there's none! 😅
I think you could perhaps repurpose some of the code of a TOC plugin; e.g. looking at https://github.com/JordanShurmer/eleventy-plugin-nesting-toc/blob/master/toc.js#L70 it seems like querying the produced HTML with selectors isn't too hard. 🤔
Conversation
Notices
-
Embed this notice
Bojidar Marinov (bojidar_bg@mastodon.social)'s status on Monday, 07-Jul-2025 09:12:20 JST
Bojidar Marinov