Skip to content

Commit aee743c

Browse files
authored
[Docs Site] Raise maxBuffer in lastUpdated spawnSync usage (#22066)
1 parent 7318c8d commit aee743c

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

patches/@astrojs+starlight+0.34.1.patch

+12
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,15 @@ index 6d173df..61eed80 100644
2424
{label}
2525
</a>
2626
</li>
27+
diff --git a/node_modules/@astrojs/starlight/utils/git.ts b/node_modules/@astrojs/starlight/utils/git.ts
28+
index 1536fac..94876b1 100644
29+
--- a/node_modules/@astrojs/starlight/utils/git.ts
30+
+++ b/node_modules/@astrojs/starlight/utils/git.ts
31+
@@ -72,6 +72,7 @@ export function getAllNewestCommitDate(rootPath: string, docsPath: string): [str
32+
{
33+
cwd: repoRoot,
34+
encoding: 'utf-8',
35+
+ maxBuffer: 10 * 1024 * 1024,
36+
}
37+
);
38+

src/components/overrides/Head.astro

+10-1
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)