From daa47ebfd618d3111e95df782dd2490a01fee4dd Mon Sep 17 00:00:00 2001 From: Lukas Hirt Date: Sat, 26 Sep 2026 00:37:34 +0200 Subject: [PATCH 1/3] fix: dedupe homepage hero heading and browser tab title Setting the homepage's own title to match the tagline (to fix the earlier 'memaudit docs | memaudit docs' tab-title duplication) created a different duplication: Starlight's splash hero renders the page's title as its H1 by default, so the heading and tagline ended up showing near- identical text. Sets hero.title explicitly to 'memaudit' (decoupling the H1 from the page's frontmatter title) and overrides the homepage's tag directly via Starlight's head frontmatter field, so it reads just 'memaudit documentation' instead of the default '{page} | {site}' template applied everywhere else. Signed-off-by: Lukas Hirt <info@hirt.cz> --- src/content/docs/index.mdx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/content/docs/index.mdx b/src/content/docs/index.mdx index 0e753d4..f6e2da8 100644 --- a/src/content/docs/index.mdx +++ b/src/content/docs/index.mdx @@ -1,8 +1,12 @@ --- -title: See where your DRAM actually goes +title: memaudit documentation description: Reference documentation for memauditd, the read-only host agent for measuring cold memory, stranded DRAM, and KV-cache waste on Linux. +head: + - tag: title + content: memaudit documentation template: splash hero: + title: memaudit tagline: See where your DRAM actually goes. actions: - text: Config reference From cf9af721175429c6ac69f1ea17746b7c0a8ec2e9 Mon Sep 17 00:00:00 2001 From: Lukas Hirt <info@hirt.cz> Date: Sat, 26 Sep 2026 00:38:32 +0200 Subject: [PATCH 2/3] fix: align the sitewide title suffix with the homepage's override Every page's browser tab reads '{page} | memaudit docs' from Starlight's site-wide title config, which no longer matched the homepage's own 'memaudit documentation' override from the previous commit. Renamed the site-wide title to match, so the pattern is consistent everywhere: '{page} | memaudit documentation'. Note this also changes the persistent nav header text next to the logo (visible on every page), not just tab titles - flagged to the repo owner in case the shorter 'memaudit docs' was preferred there specifically. Signed-off-by: Lukas Hirt <info@hirt.cz> --- astro.config.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/astro.config.mjs b/astro.config.mjs index 3105212..9345bef 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -9,7 +9,7 @@ export default defineConfig({ site: 'https://docs.memaudit.dev', integrations: [ starlight({ - title: 'memaudit docs', + title: 'memaudit documentation', logo: { src: './src/assets/logo.svg', alt: 'memaudit', From 67ecfb8dfb96e22d39d66c2cc808d02724425439 Mon Sep 17 00:00:00 2001 From: Lukas Hirt <info@hirt.cz> Date: Sat, 26 Sep 2026 00:40:38 +0200 Subject: [PATCH 3/3] feat: show a shorter nav header title than the meta title Overrides Starlight's default SiteTitle component so the visible nav header reads just 'memaudit' while the sitewide title config ('memaudit documentation') still drives the browser tab title and og:site_name metadata everywhere. Keeps everything else in the original component unchanged (logo rendering, link href). Signed-off-by: Lukas Hirt <info@hirt.cz> --- astro.config.mjs | 6 ++++ src/components/SiteTitle.astro | 66 ++++++++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 src/components/SiteTitle.astro diff --git a/astro.config.mjs b/astro.config.mjs index 9345bef..a713f6c 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -20,6 +20,12 @@ export default defineConfig({ { icon: 'github', label: 'GitHub', href: 'https://github.com/memaudit/memaudit' }, ], plugins: [starlightLinksValidator()], + components: { + // Shows "memaudit" in the visible nav header while the + // site title above ("memaudit documentation") still + // drives the browser tab title and other metadata. + SiteTitle: './src/components/SiteTitle.astro', + }, sidebar: [ { label: 'Reference', diff --git a/src/components/SiteTitle.astro b/src/components/SiteTitle.astro new file mode 100644 index 0000000..718c38e --- /dev/null +++ b/src/components/SiteTitle.astro @@ -0,0 +1,66 @@ +--- +// SPDX-FileCopyrightText: 2026 the memaudit authors +// SPDX-License-Identifier: Apache-2.0 +// +// Overrides Starlight's default SiteTitle component to show a shorter +// name in the visible nav header ("memaudit") than the site's configured +// title ("memaudit documentation"), which still drives the browser tab +// title and other metadata. See https://starlight.astro.build/guides/overriding-components/ +import { logos } from 'virtual:starlight/user-images'; +import config from 'virtual:starlight/user-config'; +const { siteTitleHref } = Astro.locals.starlightRoute; +const navTitle = 'memaudit'; +--- + +<a href={siteTitleHref} class="site-title sl-flex"> + { + config.logo && logos.dark && ( + <> + <img + class:list={{ 'light:sl-hidden print:hidden': !('src' in config.logo) }} + alt={config.logo.alt} + src={logos.dark.src} + width={logos.dark.width} + height={logos.dark.height} + /> + {!('src' in config.logo) && ( + <img + class="dark:sl-hidden print:block" + alt={config.logo.alt} + src={logos.light?.src} + width={logos.light?.width} + height={logos.light?.height} + /> + )} + </> + ) + } + <span class:list={{ 'sr-only': config.logo?.replacesTitle }} translate="no"> + {navTitle} + </span> +</a> + +<style> + @layer starlight.core { + .site-title { + align-items: center; + gap: var(--sl-nav-gap); + font-size: var(--sl-text-h4); + font-weight: 600; + color: var(--sl-color-text-accent); + text-decoration: none; + white-space: nowrap; + min-width: 0; + } + span { + overflow: hidden; + } + img { + height: calc(var(--sl-nav-height) - 2 * var(--sl-nav-pad-y)); + width: auto; + max-width: 100%; + object-fit: contain; + object-position: 0 50%; + } + } +</style>