From a88e284c1e52e3896c6c21be2f92704b5a42baaa Mon Sep 17 00:00:00 2001 From: Daniel Kluge Date: Sun, 22 Mar 2026 22:19:42 +0100 Subject: [PATCH] Remove artifacts and set language of markdown sites --- .gitattributes | 2 ++ src/remark-modified-time.mjs | 22 ---------------------- 2 files changed, 2 insertions(+), 22 deletions(-) create mode 100644 .gitattributes delete mode 100644 src/remark-modified-time.mjs diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..871cb8a --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +*.md linguist-language=Astro +*.mdx linguist-language=Astro diff --git a/src/remark-modified-time.mjs b/src/remark-modified-time.mjs deleted file mode 100644 index 1881cca..0000000 --- a/src/remark-modified-time.mjs +++ /dev/null @@ -1,22 +0,0 @@ -import { execSync } from "child_process"; -import { statSync } from "fs"; - -export function remarkModifiedTime() { - return function (tree, file) { - const filepath = file.history[0]; - try { - const result = execSync(`git log -1 --pretty="format:%cI" "${filepath}"`); - // If result is empty or undefined, fallback to fs stat - if (!result || !result.toString().trim()) { - throw new Error("No git history"); - } - file.data.astro.frontmatter.lastModified = result.toString(); - return; - } catch (e) { - // Ignore, fallback to fs stat - const result = statSync(filepath); - file.data.astro.frontmatter.lastModified = result.mtime.toISOString(); - return; - } - }; -}