Skip to content

Commit

Permalink
fix(docs): replace deprecated translation API (#1181)
Browse files Browse the repository at this point in the history
  • Loading branch information
zerok authored Oct 1, 2024
1 parent cf9e926 commit edc0541
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions docs/src/components/MobileTableOfContents.astro
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import TableOfContentsList from './TableOfContentsList.astro';
import type { Props } from '@astrojs/starlight/props'
const { labels, toc, slug } = Astro.props;
const { toc, slug } = Astro.props;
---

{
Expand All @@ -14,7 +14,7 @@ const { labels, toc, slug } = Astro.props;
<details id="starlight__mobile-toc">
<summary id="starlight__on-this-page--mobile" class="sl-flex">
<div class="toggle sl-flex">
{labels['tableOfContents.onThisPage']}
{Astro.locals.t('tableOfContents.onThisPage')}
<Icon name={'right-caret'} class="caret" size="1rem" />
</div>
<span class="display-current" />
Expand Down Expand Up @@ -148,4 +148,4 @@ const { labels, toc, slug } = Astro.props;
}

customElements.define('mobile-starlight-toc', MobileStarlightTOC);
</script>
</script>
6 changes: 3 additions & 3 deletions docs/src/components/TableOfContents.astro
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
import TableOfContentsList from './TableOfContentsList.astro';
import type { Props } from '@astrojs/starlight/props'
const { labels, toc,slug } = Astro.props;
const { toc, slug } = Astro.props;
---

{
toc && (
<starlight-toc data-min-h={toc.minHeadingLevel} data-max-h={toc.maxHeadingLevel}>
<nav aria-labelledby="starlight__on-this-page">
<h2 id="starlight__on-this-page">{labels['tableOfContents.onThisPage']}</h2>
<h2 id="starlight__on-this-page">{Astro.locals.t('tableOfContents.onThisPage')}</h2>
<TableOfContentsList toc={toc.items} basePath={slug} />
</nav>
</starlight-toc>
)
}

<script src="./starlight-toc.ts"></script>
<script src="./starlight-toc.ts"></script>

0 comments on commit edc0541

Please sign in to comment.