9 lines
No EOL
358 B
JavaScript
9 lines
No EOL
358 B
JavaScript
import { execSync } from "node:child_process";
|
|
|
|
export function remarkModifiedTime() {
|
|
return (tree, file) => {
|
|
const filepath = file.history[0];
|
|
const result = import.meta.env.PUBLIC_COMMIT === "" ? "Unavailable" : execSync(`git log -1 --pretty="format:%cI" "${filepath}"`);
|
|
file.data.astro.frontmatter.lastModified = result.toString();
|
|
};
|
|
} |