diff --git a/11ty/CustomLiquid.ts b/11ty/CustomLiquid.ts index 3cf11c248e..b8f550f022 100644 --- a/11ty/CustomLiquid.ts +++ b/11ty/CustomLiquid.ts @@ -563,6 +563,18 @@ export class CustomLiquid extends Liquid { $el.prepend(`

Example

`); }); + // Perform second pass over notes/examples, to number when there are multiple in one section or dd + $("#key-terms dd, #success-criterion").each((_, containerEl) => { + for (const selector of [".example-title", ".note-title"]) { + const $titles = $(containerEl).find(selector); + if ($titles.length > 1) { + $titles.each((i, el) => { + $(el).text(`${$(el).text()} ${i + 1}`); + }); + } + } + }); + // We don't need to do any more processing for index/about pages other than stripping comments if (indexPattern.test(scope.page.inputPath)) return stripHtmlComments($.html());