diff --git a/src/app.html b/src/app.html index 2a3de6a..8d94225 100644 --- a/src/app.html +++ b/src/app.html @@ -7,30 +7,26 @@ - - - + + + - - + + diff --git a/src/lib/components/atoms/Banner.svelte b/src/lib/components/atoms/Banner.svelte index 83bf6ea..5e9051c 100644 --- a/src/lib/components/atoms/Banner.svelte +++ b/src/lib/components/atoms/Banner.svelte @@ -14,7 +14,7 @@ diff --git a/src/lib/components/atoms/TableOfContents.svelte b/src/lib/components/atoms/TableOfContents.svelte index a0bc5b3..0cc7e2e 100644 --- a/src/lib/components/atoms/TableOfContents.svelte +++ b/src/lib/components/atoms/TableOfContents.svelte @@ -4,6 +4,7 @@ interface Section { name: string; id: string; + subsections?: Section[]; } export let sections: Section[] = []; @@ -30,6 +31,14 @@ if (sectionElement) { observer.observe(sectionElement); } + if (section.subsections) { + section.subsections.forEach((subsection) => { + const subsectionElement = document.getElementById(subsection.id); + if (subsectionElement) { + observer.observe(subsectionElement); + } + }); + } }); return () => { @@ -43,6 +52,15 @@ {#each sections as section}