diff --git a/src/pages/[...slug].astro b/src/pages/[...slug].astro index bd981f2..462611c 100644 --- a/src/pages/[...slug].astro +++ b/src/pages/[...slug].astro @@ -15,6 +15,10 @@ const isProd = import.meta.env.PROD; const {render, data} = Astro.props; const {title, lastModified} = data; const { Content, headings } = await render(); + +if (isProd && lastModified === undefined) { + console.log({props: Astro.props, content: Content}) +} ---
diff --git a/src/plugins/remark-last-modified.ts b/src/plugins/remark-last-modified.ts index e63a689..cf2277a 100644 --- a/src/plugins/remark-last-modified.ts +++ b/src/plugins/remark-last-modified.ts @@ -5,7 +5,7 @@ export const remarkModifiedTime: RemarkPlugins[number] = () => { return function (_, file) { const filepath = file.history[0]; 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 if (result === "") {