adds eslint

This commit is contained in:
geoffsee
2025-06-24 17:29:52 -04:00
committed by Geoff Seemueller
parent 9698fc6f3b
commit 02c3253343
169 changed files with 4896 additions and 4804 deletions

View File

@@ -1,18 +1,19 @@
import Routes from "../renderer/routes";
import type { PageContextServer } from 'vike/types';
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 getTitle = path => {
return Routes[normalizePath(path)]?.heroLabel || '';
};
const normalizePath = (path) => {
if (!path) return "/";
if (path.length > 1 && path.endsWith("/")) {
const normalizePath = path => {
if (!path) return '/';
if (path.length > 1 && path.endsWith('/')) {
path = path.slice(0, -1);
}
return path.toLowerCase();