Skip to content

Commit bce7269

Browse files
committed
[Docs site] Add last updated metadata
1 parent 57826ea commit bce7269

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/components/overrides/Head.astro

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ const NOINDEX_PRODUCTS = ["email-security", "style-guide", "security"];
1212
const currentSection = Astro.url.pathname.split("/")[1].replaceAll(".", "");
1313
1414
const entry = Astro.locals.starlightRoute.entry;
15+
const lastUpdated = Astro.locals.starlightRoute.lastUpdated
1516
const frontmatter = entry.data;
1617
const head = frontmatter.head;
1718
@@ -64,6 +65,18 @@ if (currentSection) {
6465
});
6566
}
6667
68+
if (lastUpdated) {
69+
const daysBetweenUpdate = differenceInCalendarDays(new Date(), lastUpdated);
70+
head.push({
71+
tag: "meta",
72+
attrs: {
73+
name: "pcx_last_modified",
74+
content: daysBetweenUpdate.toString(),
75+
},
76+
content: "",
77+
});
78+
}
79+
6780
if (product.data.product.group) {
6881
head.push({
6982
tag: "meta",

0 commit comments

Comments
 (0)