refactor guide pages to use content collections

also configuration->guide
This commit is contained in:
outfoxxed 2025-05-13 20:56:31 -07:00
parent a449f976c7
commit b066a48976
Signed by: outfoxxed
GPG key ID: 4C88A185FB89301E
13 changed files with 68 additions and 83 deletions

View file

@ -38,29 +38,7 @@ export function buildHierarchy(headings: ConfigHeading[]) {
export function groupRoutes(routes: RouteData[]): GroupedRoutes {
const froutes = routes.filter(route => route.name !== "index");
const defaultValue = {
tutorials: {
configuration: [
{ name: "Getting Started", type: "getting-started" },
{ name: "Intro", type: "intro" },
{ name: "Positioning", type: "positioning" },
{ name: "QML Overview", type: "qml-overview" },
],
},
types: {},
};
return froutes.reduce<GroupedRoutes>((acc, route) => {
if (!acc.tutorials) {
acc.tutorials = {
configuration: [
{ name: "Getting Started", type: "getting-started" },
{ name: "Intro", type: "intro" },
{ name: "Positioning", type: "positioning" },
{ name: "QML Overview", type: "qml-overview" },
],
};
}
if (!acc.types) acc.types = {};
if (!acc.types[route.type]) {
@ -72,7 +50,7 @@ export function groupRoutes(routes: RouteData[]): GroupedRoutes {
type: route.type,
});
return acc;
}, defaultValue);
}, { types: {} });
}
export function getQMLTypeLinkObject(unparsed: string) {