Fix broken docker build from last modified attempt 2
This commit is contained in:
parent
1490a0b269
commit
aa7cf4a987
2 changed files with 2 additions and 2 deletions
|
@ -3,7 +3,7 @@ import { execSync } from "node:child_process";
|
|||
export function remarkModifiedTime() {
|
||||
return (tree, file) => {
|
||||
const filepath = file.history[0];
|
||||
const result = execSync(`git log -1 --pretty="format:%cI" "${filepath}"`);
|
||||
const result = import.meta.env.PUBLIC_COMMIT === "" ? "Unavailable" : execSync(`git log -1 --pretty="format:%cI" "${filepath}"`);
|
||||
file.data.astro.frontmatter.lastModified = result.toString();
|
||||
};
|
||||
}
|
|
@ -18,7 +18,7 @@ export async function getStaticPaths() {
|
|||
const { post } = Astro.props;
|
||||
const { Content, remarkPluginFrontmatter } = await render(post);
|
||||
|
||||
const lastModified = import.meta.env.PUBLIC_COMMIT === "" ? "Unavailable" : dayjs(remarkPluginFrontmatter.lastModified)
|
||||
const lastModified = dayjs(remarkPluginFrontmatter.lastModified)
|
||||
.utc()
|
||||
.format("HH:mm:ss DD MMMM YYYY UTC");
|
||||
---
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue