mirror of
https://github.com/netbirdio/docs.git
synced 2026-10-09 15:19:04 +02:00
Harden last-updated dates: CI guard, SEO metadata, View history link (#904)
This commit is contained in:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user