Trim, console log lastModified

This commit is contained in:
2024-03-11 00:06:33 -05:00
parent 76ce7e4214
commit 129cbce901
2 changed files with 5 additions and 1 deletions

View File

@@ -15,6 +15,10 @@ const isProd = import.meta.env.PROD;
const {render, data} = Astro.props; const {render, data} = Astro.props;
const {title, lastModified} = data; const {title, lastModified} = data;
const { Content, headings } = await render(); const { Content, headings } = await render();
if (isProd && lastModified === undefined) {
console.log({props: Astro.props, content: Content})
}
--- ---
<Main {headings} { ...data}> <Main {headings} { ...data}>

View File

@@ -5,7 +5,7 @@ export const remarkModifiedTime: RemarkPlugins[number] = () => {
return function (_, file) { return function (_, file) {
const filepath = file.history[0]; const filepath = file.history[0];
const command = `git log -1 --pretty="format:%cI" "${filepath}"`; const command = `git log -1 --pretty="format:%cI" "${filepath}"`;
let result = execSync(command).toString(); let result = execSync(command).toString().trim();
// File is not in git yet // File is not in git yet
if (result === "") { if (result === "") {