diff --git a/README.md b/README.md index fc80343..4783c73 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,8 @@ The template docs are built with [Starlight](https://starlight.astro.build). Eac Page titles are written for search, so `src/routeData.ts` turns "Work with the database" into "Work with the database | Clean Minimal API for .NET" in the browser tab, and leaves the heading alone. `src/data/structured-data.ts` adds the JSON-LD that tells search engines and LLMs what each template is. Give every page a short, plain title and a description and they do the rest. +`src/components/docs/TwoColumnContent.astro` is a copy of Starlight's own, changed so the organisation footer (`OrgFooter.astro`) sits after `
` and screen readers list it as the page footer. When you upgrade Starlight, diff it against `node_modules/@astrojs/starlight/dist/components/TwoColumnContent.astro` and carry over anything new. + To add a page, drop a Markdown or MDX file in the template's folder and add it to that template's sidebar. `npm run build` checks every internal link and heading anchor across the docs and fails if one is broken. The build also writes the docs out for LLMs: `llms.txt` lists the templates and their key pages, `llms-full.txt` and `llms-small.txt` hold everything, and `_llms-txt/` has one file per template and one for the brand, so a model asked about one template only has to read that one. A new template's file appears once it's in `src/data/templates.ts`. diff --git a/astro.config.mjs b/astro.config.mjs index aabf73c..0c6cc12 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -168,7 +168,7 @@ export default defineConfig({ Hero: './src/components/docs/Hero.astro', ThemeSelect: './src/components/docs/ThemeSelect.astro', Sidebar: './src/components/docs/Sidebar.astro', - Footer: './src/components/docs/Footer.astro', + TwoColumnContent: './src/components/docs/TwoColumnContent.astro', }, plugins: [ starlightSidebarTopics( diff --git a/src/components/docs/Footer.astro b/src/components/docs/Footer.astro deleted file mode 100644 index be43f26..0000000 --- a/src/components/docs/Footer.astro +++ /dev/null @@ -1,68 +0,0 @@ ---- -import Default from '@astrojs/starlight/components/Footer.astro'; - -const community = 'https://github.com/LeanMeanCleanApps/.github/blob/main'; ---- - - - - - diff --git a/src/components/docs/OrgFooter.astro b/src/components/docs/OrgFooter.astro new file mode 100644 index 0000000..0c7218d --- /dev/null +++ b/src/components/docs/OrgFooter.astro @@ -0,0 +1,83 @@ +--- +// The organisation footer under every docs page. TwoColumnContent renders it after
, so it's the +// page's footer landmark ("content information" to a screen reader) and not part of the article. +// Starlight's own footer (Edit page, Last updated, Previous and Next) stays inside
, because it +// belongs to the page. +const community = 'https://github.com/LeanMeanCleanApps/.github/blob/main'; +--- + + + + diff --git a/src/components/docs/TwoColumnContent.astro b/src/components/docs/TwoColumnContent.astro new file mode 100644 index 0000000..4b3a99b --- /dev/null +++ b/src/components/docs/TwoColumnContent.astro @@ -0,0 +1,79 @@ +--- +// Starlight's TwoColumnContent from @astrojs/starlight 0.42.8, with one change: the organisation footer +// renders after
instead of inside it, so it's the page's footer landmark. Starlight doesn't let +// us override Page.astro, where
lives, and this is the closest component that wraps it. +// When Starlight is upgraded, diff this against node_modules/@astrojs/starlight/dist/components/TwoColumnContent.astro. +import OrgFooter from './OrgFooter.astro'; +--- + +
+ { + Astro.locals.starlightRoute.toc && ( + + ) + } +
+ + +
+
+ +