diff --git a/_config.ts b/_config.ts index 23ef3a419..c5ff8bec3 100644 --- a/_config.ts +++ b/_config.ts @@ -184,6 +184,19 @@ site.scopedUpdates( (path) => path.startsWith("/api/deno/"), ); +// Do more expensive operations if we're building the full site +if (Deno.env.get("BUILD_TYPE") == "FULL") { + console.log("Including resource-heavy operations in the build"); + + // Use Lume's built in date function to get the last modified date of the file + // This will replace the default date exposed to the page layouts + site.data("date", "Git Last Modified"); + + // Generate Open Graph images + // TODO: Add custom OG iomage generation + // site.use(ogImages()); +} + const SKIP_CHECK_URLS = (Deno.env.get("SKIP_CHECK_URLS") || "false") .toLowerCase(); diff --git a/_includes/doc.tsx b/_includes/doc.tsx index 736456c28..54bded777 100644 --- a/_includes/doc.tsx +++ b/_includes/doc.tsx @@ -19,6 +19,10 @@ export default function Page(props: Lume.Data, helpers: Lume.Helpers) { throw new Error("Missing sidebar for " + props.url); } + function displayDate(date: Date): string { + return date.toISOString().slice(0, 10); + } + function walk( sidebarItems: SidebarItem[], ): [SidebarItem[], number] | undefined { @@ -153,6 +157,11 @@ export default function Page(props: Lume.Data, helpers: Lume.Helpers) { }} > + +