diff --git a/astro.config.mjs b/astro.config.mjs index add434d..92e4a3c 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -1,8 +1,9 @@ import { defineConfig } from "astro/config"; import tailwindcss from "@tailwindcss/vite"; -import { remarkModifiedTime } from "./remark-modified-time.mjs"; export default defineConfig({ + site: "https://thiloho.github.io", + prefetch: { prefetchAll: true, }, @@ -15,6 +16,5 @@ export default defineConfig({ shikiConfig: { theme: "github-dark", }, - remarkPlugins: [remarkModifiedTime], }, }); diff --git a/remark-modified-time.mjs b/remark-modified-time.mjs deleted file mode 100644 index f0d8284..0000000 --- a/remark-modified-time.mjs +++ /dev/null @@ -1,9 +0,0 @@ -import { execSync } from "child_process"; - -export const remarkModifiedTime = () => { - return (file) => { - const filepath = file.history[0]; - const result = execSync(`git log -1 --pretty="format:%cI" "${filepath}"`); - file.data.astro.frontmatter.lastModified = result.toString(); - }; -} \ No newline at end of file diff --git a/src/components/Date.astro b/src/components/Date.astro index 249ae87..0d19a4e 100644 --- a/src/components/Date.astro +++ b/src/components/Date.astro @@ -1,29 +1,17 @@ --- interface Props { - date: Date | string; + date: Date; } const { date } = Astro.props; - -const isStringDate = typeof date === "string"; -const transformedDate = isStringDate ? new Date(date) : date; - -// Create the base options object -const localeOptions = { - year: "numeric", - month: "long", - day: "numeric", -}; - -// Conditionally add time options if it's a string date -if (isStringDate) { - Object.assign(localeOptions, { - hour: "2-digit", - minute: "2-digit" - }); -} --- - \ No newline at end of file + diff --git a/src/components/Header.astro b/src/components/Header.astro index 8ebc260..bba7292 100644 --- a/src/components/Header.astro +++ b/src/components/Header.astro @@ -22,7 +22,7 @@ const { title, pubDate, modDate } = Astro.props; Published:
Last modified:{" "} - {modDate ? : No changes yet} + {modDate ? : No modifications}

) : ( diff --git a/src/content/blog/privacy-focused-operating-systems.md b/src/content/blog/privacy-focused-operating-systems.md index ed0f723..c7bac21 100644 --- a/src/content/blog/privacy-focused-operating-systems.md +++ b/src/content/blog/privacy-focused-operating-systems.md @@ -3,6 +3,7 @@ id: 2 title: "Privacy-focused operating systems" description: "Good choices for privacy-focused operating systems for desktop and mobile phones." pubDate: "2025-01-16" +modDate: "2025-04-26" --- ## Introduction diff --git a/src/pages/blog/[slug].astro b/src/pages/blog/[slug].astro index b194945..c41664c 100644 --- a/src/pages/blog/[slug].astro +++ b/src/pages/blog/[slug].astro @@ -17,14 +17,14 @@ if (!article) { throw new Error(); } -const { Content, headings, remarkPluginFrontmatter } = await render(article); +const { Content, headings } = await render(article); ---