mirror of
https://github.com/thiloho/thiloho.github.io.git
synced 2025-11-22 02:11:35 +01:00
Initialize project with general functionality
This commit is contained in:
9
remark-modified-time.mjs
Normal file
9
remark-modified-time.mjs
Normal file
@@ -0,0 +1,9 @@
|
||||
import { execSync } from "child_process";
|
||||
|
||||
export const remarkModifiedTime = () => {
|
||||
return (tree, file) => {
|
||||
const filepath = file.history[0];
|
||||
const result = execSync(`git log -1 --pretty="format:%cI" "${filepath}"`);
|
||||
file.data.astro.frontmatter.lastModified = result.toString();
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user