diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/content/dependencies/generateContentHeading.js | 9 | ||||
-rw-r--r-- | src/static/js/client.js | 6 |
2 files changed, 12 insertions, 3 deletions
diff --git a/src/content/dependencies/generateContentHeading.js b/src/content/dependencies/generateContentHeading.js index 2753fe86..eafe77d8 100644 --- a/src/content/dependencies/generateContentHeading.js +++ b/src/content/dependencies/generateContentHeading.js @@ -12,6 +12,11 @@ export default { mutable: false, }, + stickyTitle: { + type: 'html', + mutable: false, + }, + accent: { type: 'html', mutable: false, @@ -44,6 +49,10 @@ export default { {[html.onlyIfContent]: true}, slots.title), + html.tag('template', {class: 'content-heading-sticky-title'}, + {[html.onlyIfContent]: true}, + slots.stickyTitle), + html.tag('span', {class: 'content-heading-accent'}, {[html.onlyIfContent]: true}, slots.accent), diff --git a/src/static/js/client.js b/src/static/js/client.js index 8b470832..1911c6f7 100644 --- a/src/static/js/client.js +++ b/src/static/js/client.js @@ -2706,9 +2706,9 @@ function updateStickySubheadingContent(index) { } const textContainer = - closestHeading.querySelector('.content-heading-main-title') - // Just for compatibility with older builds of the site. - ?? closestHeading; + templateContent( + closestHeading.querySelector('.content-heading-sticky-title')) ?? + closestHeading.querySelector('.content-heading-main-title'); for (const child of textContainer.childNodes) { if (child.tagName === 'A') { |