Skip to content

Commit 8f4f2da

Browse files
committed
add pcx_last_modified
1 parent 8238cc1 commit 8f4f2da

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/components/overrides/Head.astro

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const NOINDEX_PRODUCTS = ["email-security", "style-guide", "security"];
1212
1313
const currentSection = Astro.url.pathname.split("/")[1].replaceAll(".", "");
1414
15-
const { entry, head } = Astro.locals.starlightRoute;
15+
const { entry, head, lastUpdated } = Astro.locals.starlightRoute;
1616
const frontmatter = entry.data;
1717
1818
const metaTags = [] as Record<string, string>[];
@@ -126,6 +126,15 @@ if (frontmatter.tags) {
126126
});
127127
}
128128
129+
if (lastUpdated) {
130+
const daysBetween = differenceInCalendarDays(new Date(), lastUpdated);
131+
132+
metaTags.push({
133+
name: "pcx_last_modified",
134+
content: daysBetween.toString(),
135+
});
136+
}
137+
129138
if (frontmatter.updated) {
130139
const daysBetween = differenceInCalendarDays(new Date(), frontmatter.updated);
131140

0 commit comments

Comments
 (0)