From 4f15486742ff9ce52fa5005edfc31647f2d97374 Mon Sep 17 00:00:00 2001
From: thiloho <123883702+thiloho@users.noreply.github.com>
Date: Sat, 26 Apr 2025 09:57:29 +0200
Subject: [PATCH] Set site url and remove old logic
---
astro.config.mjs | 4 +--
remark-modified-time.mjs | 9 ------
src/components/Date.astro | 32 ++++++-------------
src/components/Header.astro | 2 +-
.../blog/privacy-focused-operating-systems.md | 1 +
src/pages/blog/[slug].astro | 4 +--
6 files changed, 16 insertions(+), 36 deletions(-)
delete mode 100644 remark-modified-time.mjs
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 ?