markup/tableofcontents: Add pre/post config options#14313
markup/tableofcontents: Add pre/post config options#14313nathannewyen wants to merge 1 commit intogohugoio:masterfrom
Conversation
Add Pre and Post configuration options to customize the HTML wrapper around the table of contents. This allows users to add custom elements like headings for accessibility. Example config: [markup.tableOfContents] pre = '<nav id="TableOfContents"><h2>Contents</h2>' post = '</nav>' The pre/post parameters are optional in ToHTML() for backward compatibility - existing templates continue to work without changes. Fixes gohugoio#8338
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. |
AI Detection Analysis 🔍Confidence Score: 25% Reasoning: The pull request adds new configuration options (pre/post HTML wrappers) to an open-source project, with carefully explained rationale and code changes. The tone is pragmatic, technically accurate, and formatted in a way that suggests knowledge of both the underlying system and the expectations of other developers. There is a clear reference to issue #8338, and the description integrates user-oriented benefits (such as accessibility enhancements) with implementation details, balancing clarity and precision—traits more typical of human authorship. Key Indicators:
These elements suggest a human developer familiar with both the technical domain and the collaborative practices of open-source development. ✅ No strong indicators of AI generation detected |
|
Let's put this on hold per my comments here: |
Add Pre and Post configuration options to customize the HTML wrapper around the table of contents.
This allows users to add custom elements like headings for accessibility:
The pre/post parameters are optional in
ToHTML()for backward compatibility - existing templates continue to work without changes.Fixes #8338