diff --git a/patches/@astrojs+starlight+0.34.1.patch b/patches/@astrojs+starlight+0.34.1.patch index 4717d735309737..6b2ff52c4e92b1 100644 --- a/patches/@astrojs+starlight+0.34.1.patch +++ b/patches/@astrojs+starlight+0.34.1.patch @@ -24,3 +24,15 @@ index 6d173df..61eed80 100644 {label} +diff --git a/node_modules/@astrojs/starlight/utils/git.ts b/node_modules/@astrojs/starlight/utils/git.ts +index 1536fac..94876b1 100644 +--- a/node_modules/@astrojs/starlight/utils/git.ts ++++ b/node_modules/@astrojs/starlight/utils/git.ts +@@ -72,6 +72,7 @@ export function getAllNewestCommitDate(rootPath: string, docsPath: string): [str + { + cwd: repoRoot, + encoding: 'utf-8', ++ maxBuffer: 10 * 1024 * 1024, + } + ); + diff --git a/src/components/overrides/Head.astro b/src/components/overrides/Head.astro index 19d955c7c87605..8cc1ddff61e004 100644 --- a/src/components/overrides/Head.astro +++ b/src/components/overrides/Head.astro @@ -12,7 +12,7 @@ const NOINDEX_PRODUCTS = ["email-security", "style-guide", "security"]; const currentSection = Astro.url.pathname.split("/")[1].replaceAll(".", ""); -const { entry, head } = Astro.locals.starlightRoute; +const { entry, head, lastUpdated } = Astro.locals.starlightRoute; const frontmatter = entry.data; const metaTags = [] as Record[]; @@ -126,6 +126,15 @@ if (frontmatter.tags) { }); } +if (lastUpdated) { + const daysBetween = differenceInCalendarDays(new Date(), lastUpdated); + + metaTags.push({ + name: "pcx_last_modified", + content: daysBetween.toString(), + }); +} + if (frontmatter.updated) { const daysBetween = differenceInCalendarDays(new Date(), frontmatter.updated);