Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(docs): replace deprecated translation API #1181

Merged
merged 1 commit into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>
Loading