public/composables/metadata.ts

30 lines
778 B
TypeScript
Raw Normal View History

2022-08-07 11:37:29 -04:00
/**
* Set the page title in the format [title] | [site name].
2022-08-07 11:37:29 -04:00
* @param title The title string.
*/
2022-08-10 20:31:16 -04:00
export function useTitle(title: string, description?: string) {
2022-08-10 18:34:01 -04:00
useHead({
title: `${title} | Oeufs?`,
2022-08-10 20:31:16 -04:00
meta: [
{ name: "viewport", content: " width=device-width,initial-scale=1" },
{ name: "description", content: description ?? "" },
2022-08-10 20:31:16 -04:00
{ name: "theme-color", content: "#ffffff" },
],
2022-08-10 18:34:01 -04:00
link: [
{ rel: "icon", type: "image/x-icon", href: "/favicon.ico" },
{
rel: "stylesheet",
href: "https://cdn.jsdelivr.net/npm/katex@0.16.0/dist/katex.min.css",
},
],
2022-08-12 21:04:50 -04:00
script: [
{
defer: true,
src: "/script.js",
hid: "stupidEmergencyScript",
type: "module",
},
],
2022-08-10 18:34:01 -04:00
});
2022-08-07 11:37:29 -04:00
}