Skip to content
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
4 changes: 2 additions & 2 deletions docusaurus/docs/reference/components.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ renders the brand link with an href the site cannot change, and
`PrimaryMenu` repeats the developer navbar's external buttons in the mobile
drawer. The only input a site has is the `navbarLinks` option.

`Navbar/Logo` reads `siteConfig.title` (developer variant only) and
`siteConfig.customFields.projectVersion`. theme-classic renders the title inside
`Navbar/Logo` reads `siteConfig.title` and `siteConfig.customFields.projectVersion`,
both on the developer variant only; the public navbar shows neither. theme-classic renders the title inside
the brand anchor, so the override hides it there with CSS and re-renders it as
its own absolutely centred element, which is what lets the version badge sit
next to it. A version without a leading `v` gets one added.
Expand Down
4 changes: 2 additions & 2 deletions docusaurus/docs/reference/exports.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ The theme decides from `baseUrl`, and there is no override:
| anything else | public | `https://docs.vantagecompute.ai/` | search, the `Navbar/SiteActions` slot, colour-mode toggle |

The developer navbar centres `siteConfig.title` with the version badge beside
it. The public navbar shows only the badge, when `customFields.projectVersion`
is set.
it. The public navbar shows neither: it is the brand mark, search, the slot and
the toggle, and `customFields.projectVersion` is ignored there.

Sites declare no `themeConfig.navbar` and no `themeConfig.footer`. A site that
still does builds fine; the theme renders neither.
Expand Down
9 changes: 0 additions & 9 deletions src/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -2015,15 +2015,6 @@ article {
}
}

/* A site with no navbar.title still gets the version badge, alone in the
centre. Between 997 and 1024 that is a bare git hash beside the logo on a
tablet; hide it there. On wider screens the lone centred badge stays. */
@media (max-width: 1024px) {
.navbar__center-title:not(:has(.navbar__center-title-text)) {
display: none;
}
}

/* ── Tablet landscape (997 to 1199) ────────────────────────────────── */
/* Docusaurus treats this band as desktop: a 300px sidebar, a right-hand TOC
column and the article between them. At 1024 the article is 505px and the
Expand Down
12 changes: 7 additions & 5 deletions src/theme/Navbar/useVantageNavbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ export function useVantageNavbar() {
const {siteConfig} = useDocusaurusContext();
const {variant, logoHref, navbarLinks} = usePluginData('@vantagecompute/docusaurus-theme');

const raw = siteConfig.customFields?.projectVersion;
// The developer navbar names the project beside its version, which is how
// a reader confirms they are on the version they think they are. The public
// navbar is logo-only: no title and no version badge, even when the site
// sets customFields.projectVersion.
const developer = variant === 'developer';
const raw = developer ? siteConfig.customFields?.projectVersion : null;
const version = raw
? String(raw).startsWith('v')
? String(raw)
Expand All @@ -22,10 +27,7 @@ export function useVantageNavbar() {
variant,
logoHref,
links: navbarLinks,
// The developer navbar names the project beside its version, which is
// how a reader confirms they are on the version they think they are.
// The public navbar is logo-only.
title: variant === 'developer' ? siteConfig.title : null,
title: developer ? siteConfig.title : null,
version,
};
}
Expand Down