Commit 44539bc
committed
markup/tableofcontents: Add pre/post config options
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 #83381 parent b1f7e35 commit 44539bc
File tree
2 files changed
+30
-3
lines changed- hugolib
- markup/tableofcontents
2 files changed
+30
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
670 | 670 | | |
671 | 671 | | |
672 | 672 | | |
| 673 | + | |
| 674 | + | |
673 | 675 | | |
674 | 676 | | |
675 | 677 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
148 | 148 | | |
149 | 149 | | |
150 | 150 | | |
151 | | - | |
| 151 | + | |
| 152 | + | |
152 | 153 | | |
153 | 154 | | |
154 | 155 | | |
| |||
163 | 164 | | |
164 | 165 | | |
165 | 166 | | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
166 | 177 | | |
167 | 178 | | |
168 | 179 | | |
169 | 180 | | |
170 | 181 | | |
171 | 182 | | |
| 183 | + | |
| 184 | + | |
172 | 185 | | |
173 | 186 | | |
174 | 187 | | |
| |||
187 | 200 | | |
188 | 201 | | |
189 | 202 | | |
| 203 | + | |
| 204 | + | |
190 | 205 | | |
191 | 206 | | |
192 | 207 | | |
193 | 208 | | |
194 | 209 | | |
195 | 210 | | |
196 | 211 | | |
197 | | - | |
| 212 | + | |
198 | 213 | | |
199 | | - | |
| 214 | + | |
200 | 215 | | |
201 | 216 | | |
202 | 217 | | |
| |||
260 | 275 | | |
261 | 276 | | |
262 | 277 | | |
| 278 | + | |
| 279 | + | |
263 | 280 | | |
264 | 281 | | |
265 | 282 | | |
| |||
274 | 291 | | |
275 | 292 | | |
276 | 293 | | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
277 | 302 | | |
0 commit comments