From cb5b1210e23548e2983865a4b38308b0f54dc7ce Mon Sep 17 00:00:00 2001 From: Chris Swithinbank Date: Thu, 15 Jun 2023 13:42:25 +0200 Subject: Use `_top` instead of `starlight__overview` as page title ID (#210) * Use `top` instead of `starlight__overview` as page title ID * Add changeset * `_top` not `top`--- .changeset/mighty-wolves-jog.md | 7 +++++++ packages/starlight/404.astro | 2 +- packages/starlight/components/Hero.astro | 2 +- packages/starlight/components/SkipLink.astro | 2 +- packages/starlight/components/TableOfContents/generateToC.ts | 2 +- packages/starlight/components/TableOfContents/starlight-toc.ts | 2 +- packages/starlight/index.astro | 3 ++- 7 files changed, 14 insertions(+), 6 deletions(-) create mode 100644 .changeset/mighty-wolves-jog.md diff --git a/.changeset/mighty-wolves-jog.md b/.changeset/mighty-wolves-jog.md new file mode 100644 index 00000000..80f7c6e8 --- /dev/null +++ b/.changeset/mighty-wolves-jog.md @@ -0,0 +1,7 @@ +--- +'@astrojs/starlight': minor +--- + +Change page title ID to `_top` for cleaner hash URLs + +⚠️ Potentially breaking change if you were linking manually to `#starlight__overview` anywhere. If you were, update these links to use `#_top` instead. diff --git a/packages/starlight/404.astro b/packages/starlight/404.astro index ae7f1765..46cf5189 100644 --- a/packages/starlight/404.astro +++ b/packages/starlight/404.astro @@ -36,7 +36,7 @@ const { lang = 'en', dir = 'ltr', locale } = config.defaultLocale || {};
-

404

+

404

Houston, we have a problem.

We couldn’t find that link. Check the address or diff --git a/packages/starlight/components/Hero.astro b/packages/starlight/components/Hero.astro index a4768622..9bc66c7c 100644 --- a/packages/starlight/components/Hero.astro +++ b/packages/starlight/components/Hero.astro @@ -38,7 +38,7 @@ const imageAttrs = { }

-

+

{tagline &&
}
{ diff --git a/packages/starlight/components/SkipLink.astro b/packages/starlight/components/SkipLink.astro index e4e88440..38ce3cac 100644 --- a/packages/starlight/components/SkipLink.astro +++ b/packages/starlight/components/SkipLink.astro @@ -8,7 +8,7 @@ interface Props { const t = useTranslations(Astro.props.locale); --- -{t('skipLink.label')} +{t('skipLink.label')}