diff --git a/bun.lockb b/bun.lockb index 59899d7..efef766 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index 5e443ac..66e637c 100644 --- a/package.json +++ b/package.json @@ -14,8 +14,7 @@ "@astrojs/rss": "^4.0.11", "@astrojs/sitemap": "^3.2.1", "@astrojs/tailwind": "^5.1.4", - "@fontsource/geist-mono": "^5.1.1", - "@fontsource/geist-sans": "^5.1.0", + "@fontsource-variable/nunito": "^5.1.1", "@r4ai/remark-callout": "^0.6.2", "@yeskunall/astro-umami": "^0.0.3", "astro": "^5.1.7", @@ -28,5 +27,9 @@ "@biomejs/biome": "1.9.4", "@tailwindcss/typography": "^0.5.16" }, - "trustedDependencies": ["@biomejs/biome", "esbuild", "sharp"] -} + "trustedDependencies": [ + "@biomejs/biome", + "esbuild", + "sharp" + ] +} \ No newline at end of file diff --git a/src/components/Head.astro b/src/components/Head.astro index e202410..0df78c0 100644 --- a/src/components/Head.astro +++ b/src/components/Head.astro @@ -1,25 +1,7 @@ --- import "../styles/global.css"; import "../styles/callout.css"; - -import "@fontsource/geist-sans/100.css"; -import "@fontsource/geist-sans/200.css"; -import "@fontsource/geist-sans/300.css"; -import "@fontsource/geist-sans/400.css"; -import "@fontsource/geist-sans/500.css"; -import "@fontsource/geist-sans/600.css"; -import "@fontsource/geist-sans/700.css"; -import "@fontsource/geist-sans/800.css"; -import "@fontsource/geist-sans/900.css"; -import "@fontsource/geist-mono/100.css"; -import "@fontsource/geist-mono/200.css"; -import "@fontsource/geist-mono/300.css"; -import "@fontsource/geist-mono/400.css"; -import "@fontsource/geist-mono/500.css"; -import "@fontsource/geist-mono/600.css"; -import "@fontsource/geist-mono/700.css"; -import "@fontsource/geist-mono/800.css"; -import "@fontsource/geist-mono/900.css"; +import "@fontsource-variable/nunito"; interface Props { title: string; @@ -33,10 +15,6 @@ const { title, description, image = "/blog-placeholder-1.jpg" } = Astro.props; - {title} diff --git a/src/components/TableOfContents.astro b/src/components/TableOfContents.astro index dc89df2..28c3547 100644 --- a/src/components/TableOfContents.astro +++ b/src/components/TableOfContents.astro @@ -6,7 +6,7 @@ const toc = buildToc(headings); export interface Heading { depth: number; - id: string; + slug: string; text: string; } diff --git a/src/components/TableOfContentsHeading.astro b/src/components/TableOfContentsHeading.astro index bb4a591..c21bf63 100644 --- a/src/components/TableOfContentsHeading.astro +++ b/src/components/TableOfContentsHeading.astro @@ -1,12 +1,12 @@ --- -import Link from "./Link.astro"; import type { Heading } from "./TableOfContents.astro"; +import Link from "./Link.astro"; const { heading } = Astro.props; ---
  • - + {heading.text} { diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro index a5cdc3e..e0b0bfa 100644 --- a/src/layouts/Layout.astro +++ b/src/layouts/Layout.astro @@ -4,14 +4,14 @@ import Head from "@components/Head.astro"; import { SITE } from "@consts"; type Props = { - title: string; - description: string; + title: string; + description: string; }; const { title, description } = Astro.props; --- - + diff --git a/src/lib/utils.ts b/src/lib/utils.ts index 39246bf..16fabfe 100644 --- a/src/lib/utils.ts +++ b/src/lib/utils.ts @@ -5,6 +5,14 @@ export function cn(...inputs: ClassValue[]) { return twMerge(clsx(inputs)); } +export function formatDate(date: Date) { + return Intl.DateTimeFormat("en-SE", { + year: "numeric", + month: "2-digit", + day: "2-digit", + }).format(date); +} + export function readingTime(html: string) { const textOnly = html.replace(/<[^>]+>/g, ""); const wordCount = textOnly.split(/\s+/).length; diff --git a/tailwind.config.mjs b/tailwind.config.mjs index fd16b4b..a9189e5 100644 --- a/tailwind.config.mjs +++ b/tailwind.config.mjs @@ -6,8 +6,7 @@ export default { theme: { extend: { fontFamily: { - sans: ["Geist Sans", ...defaultTheme.fontFamily.sans], - mono: ["Geist Mono", ...defaultTheme.fontFamily.mono], + sans: ["Nunito", ...defaultTheme.fontFamily.sans], }, }, },