--- import "@/styles/globals.css"; import fredoka from "@fontsource/fredoka/files/fredoka-latin-400-normal.woff2?url"; import { ClientRouter } from "astro:transitions"; import MusicShelf from "@/components/MusicShelf.tsx"; import musicData from "@/data/music.json"; import type { Track } from "@/types"; import ThemeInit from "@/components/ThemeInit.astro"; import Header from "@/components/Header.astro"; import NotificationsButton from "@/components/NotificationsButton.astro"; import CornersScope from "@/components/CornersScope.astro"; import { Snow } from "@/components/Snow.tsx"; import { Toaster } from "@/components/Toaster.tsx"; import SEO from "@/components/SEO.astro"; import { SAME_AS, SITE_NAME, TWITTER, ogImage, pageDescription, pageTitle } from "@/lib/seo"; export interface Article { publishedTime: string; modifiedTime?: string; tags?: string[]; section?: string; wordCount?: number; } interface Props { title?: string; description?: string; exactDescription?: boolean; image?: string; imageAlt?: string; type?: "website" | "article"; article?: Article; noindex?: boolean; /** the path search engines should credit, for pages served under more than one */ canonicalPath?: string; atprotoDocument?: string; /** extra schema.org nodes for whatever this page actually is */ schema?: object[]; } const { title, description, exactDescription = false, image, imageAlt = "kualta.dev", type = "website", article, noindex = false, canonicalPath, atprotoDocument, schema = [], } = Astro.props; const musicPage = /^\/music(?:\/|$)/.test(Astro.url.pathname); const kaomojiPage = /^\/kaomoji(?:\/|$)/.test(Astro.url.pathname); const kaomojiResultsPage = /^\/kaomoji\/?$/.test(Astro.url.pathname); const musicSlug = musicPage ? Astro.url.pathname.split("/")[2] || undefined : undefined; const tracks = [...(musicData as Track[])].sort((a, b) => b.date.localeCompare(a.date)); const documentTitle = pageTitle(title); const metaDescription = exactDescription && description !== undefined ? description : pageDescription(description); const canonical = new URL(canonicalPath ?? Astro.url.pathname, Astro.site).toString(); const og = ogImage(image, Astro.site); const month = new Date().getMonth(); const isChristmas = month >= 10; // large thumbnails and full snippets have to be opted into; without them Google // is free to crop the share card down to a favicon and clip the summary const robots = noindex ? "noindex, nofollow" : "index, follow, max-image-preview:large, max-snippet:-1, max-video-preview:-1"; ---