rework/lightweight #12

Merged
GauthierWebDev merged 106 commits from rework/lightweight into main 2025-04-21 16:27:38 +00:00
2 changed files with 20 additions and 2 deletions
Showing only changes of commit 9e27c0bef3 - Show all commits

View File

@ -1,9 +1,27 @@
import type { PageContext } from "vike/types"; import type { PageContext } from "vike/types";
import { useConfig } from "vike-solid/useConfig";
import buildTitle from "./buildTitle";
export type Data = Awaited<ReturnType<typeof data>>; export type Data = Awaited<ReturnType<typeof data>>;
export async function data(pageContext: PageContext) { export async function data(pageContext: PageContext) {
const config = useConfig();
const {
exports: { tableOfContents, frontmatter },
urlParsed,
} = pageContext;
const isRoot = urlParsed.pathname === "/";
console.log({ isRoot, urlParsed });
config({
title: buildTitle(isRoot ? undefined : frontmatter?.title),
description: frontmatter?.description,
});
return { return {
tableOfContents: pageContext.exports.tableOfContents, tableOfContents,
}; };
} }

View File

@ -1,5 +1,5 @@
import config from "./+config"; import config from "./+config";
export function title() { export function title() {
return `Synthèses et ressources pour développeurs - ${config.title}`; return `Synthèses et ressources pour développeurs | ${config.title}`;
} }