mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-10-23 20:29:06 -05:00
generate_site.py writes the Starlight project in website/ and nothing else: mkdocs.yml, the MkDocs hooks, theme overrides and stylesheet go, and the wiki is written in Starlight's syntax. Both workflows set up Node with the official actions/setup-node pinned by commit, run npm ci from the committed lockfile, build with the strict link validator and check the result with validate_site.py. The search weighs a page by what it answers: Start here pages first, a system page's cards and file names before a guide citing them, deep guides, launchers, aliases and frozen copies after. Status badges, hash blocks and the export change lists leave the index. The ranking sits at the centre of a range where the 13 queries of search_gate.py all answer, in the search box itself. 839 pages, every URL and 45,611 ids match the MkDocs build. The tests read the Starlight content and syntax.
23 lines
874 B
TypeScript
23 lines
874 B
TypeScript
import { defineCollection } from 'astro:content';
|
|
import { z } from 'astro/zod';
|
|
import { docsLoader } from '@astrojs/starlight/loaders';
|
|
import { docsSchema } from '@astrojs/starlight/schema';
|
|
|
|
// The generator's own front matter, typed: a page with a misspelt level fails the build.
|
|
export const collections = {
|
|
docs: defineCollection({
|
|
loader: docsLoader(),
|
|
schema: docsSchema({
|
|
extend: z.object({
|
|
// Who the page is written for, from someone who knows nothing
|
|
// (start) to someone adding to the project (contribute).
|
|
level: z.enum(['start', 'setup', 'explore', 'reference', 'contribute']).optional(),
|
|
// How much the site search weighs the page's words (1 by default).
|
|
searchWeight: z.number().min(0.1).max(10).optional(),
|
|
// The date the page's content carries, for the sitemap.
|
|
lastmod: z.string().optional(),
|
|
}),
|
|
}),
|
|
}),
|
|
};
|