Files
open-gsio/packages/client/src/pages/+data.ts
geoffsee 497eb22ad8 change semantics
Update README deployment steps and add deploy:secrets script to package.json

update local inference script and README

update lockfile

reconfigure package scripts for development

update test execution

pass server tests

Update README with revised Bun commands and workspace details

remove pnpm package manager designator

create bun server
2025-06-04 18:45:08 -04:00

25 lines
642 B
TypeScript

import Routes from "../renderer/routes";
export { data };
export type Data = Awaited<ReturnType<typeof data>>;
import type { PageContextServer } from "vike/types";
// sets the window title depending on the route
const data = async (pageContext: PageContextServer) => {
const getTitle = (path) => {
return Routes[normalizePath(path)]?.heroLabel || "";
};
const normalizePath = (path) => {
if (!path) return "/";
if (path.length > 1 && path.endsWith("/")) {
path = path.slice(0, -1);
}
return path.toLowerCase();
};
return {
// The page's <title>
title: getTitle(pageContext.urlOriginal),
};
};