Browse Source

Use ToC hrefs for proper navigation

master
buttercat1791 9 months ago
parent
commit
0fc90e5ceb
  1. 5
      src/lib/components/publications/Publication.svelte
  2. 3
      src/lib/components/publications/TableOfContents.svelte

5
src/lib/components/publications/Publication.svelte

@ -167,8 +167,9 @@ @@ -167,8 +167,9 @@
<!-- Table of contents -->
{#if publicationType !== 'blog' || !isLeaf}
{#if $publicationColumnVisibility.toc}
<Sidebar class='sidebar-leather left-0 md:!pr-8 overflow-y-auto'>
<CloseButton onclick={closeToc} class='btn-leather absolute top-0 right-0' />
<Sidebar
activeUrl={`#${activeAddress ?? ''}`}
>
<TableOfContents
displayMode='sidebar'
rootAddress={rootAddress}

3
src/lib/components/publications/TableOfContents.svelte

@ -46,7 +46,6 @@ @@ -46,7 +46,6 @@
}
</script>
<!-- TODO: Href doesn't work with query params. -->
<!-- Michael J - 16 June 2025 - Accordion mode is untested. -->
{#if displayMode === 'accordion'}
<Accordion multiple>
@ -80,9 +79,9 @@ @@ -80,9 +79,9 @@
{@const expanded = toc.expandedMap.get(address) ?? false}
{@const isLeaf = toc.leaves.has(address)}
{#if isLeaf}
<!-- TODO: Add href -->
<SidebarItem
label={entry.title}
href={`#${address}`}
onclick={() => onSectionFocused?.(address)}
/>
{:else}

Loading…
Cancel
Save