mirror of
https://github.com/thiloho/thiloho.github.io.git
synced 2025-11-22 02:11:35 +01:00
9 lines
295 B
JavaScript
9 lines
295 B
JavaScript
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();
|
|
};
|
|
} |