Skip to content

Commit

Permalink
Fix On This Page links (#1147)
Browse files Browse the repository at this point in the history
On this page links to anchor headings are currently broken due to
the Astro v5 upgrade renaming all instances of 'slug' to 'id'.

Test plan:

- Confirm links to anchor headings in the On this page component
  are being set to expected values for guides and connection collections
  • Loading branch information
tom-blake authored Dec 12, 2024
1 parent 69e3a2b commit a1b21dc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/components/TocNav.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@
<ol class="mt-4">
<li
v-for="heading in visibleHeadings"
:key="heading.id"
:key="heading.slug"
>
<a
:href="`#${heading.id}`"
:href="`#${heading.slug}`"
class="flex truncate border-l-2 text-sm p-squish-2 hover:border-content-primary hover:text-content-primary"
:class="[
visibleHeadingId === heading.id ?
visibleHeadingId === heading.slug ?
'border-brand-accent text-content-primary':
'text-content-tertiary'
]"
@click="handleTocClick(heading.id)"
@click="handleTocClick(heading.slug)"
>
<span
:class="{
Expand Down

0 comments on commit a1b21dc

Please sign in to comment.