Harden last-updated dates: CI guard, SEO metadata, View history link (#904)

This commit is contained in:
Brandon Hopkins
2026-08-05 22:06:30 +02:00
committed by GitHub
parent 8aa22ac4ce
commit a51653a93d
6 changed files with 95 additions and 34 deletions
+14
View File
@@ -36,6 +36,20 @@ function rehypeInsertLastUpdated() {
const formatted = formatLastUpdated(iso)
if (!formatted) return
// Exposed to pageProps via recma-nextjs-static-props so _app.jsx can emit
// per-page SEO metadata without shipping the full route→date map client-side.
const exportStr = `export const lastUpdated = ${JSON.stringify(iso)}`
tree.children.push({
type: 'mdxjsEsm',
value: exportStr,
data: {
estree: acorn.parse(exportStr, {
sourceType: 'module',
ecmaVersion: 'latest',
}),
},
})
const node = {
type: 'element',
tagName: 'p',