Skip to content

[Docs Site] Raise maxBuffer in lastUpdated spawnSync usage #22066

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions patches/@astrojs+starlight+0.34.1.patch
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,15 @@ index 6d173df..61eed80 100644
{label}
</a>
</li>
diff --git a/node_modules/@astrojs/starlight/utils/git.ts b/node_modules/@astrojs/starlight/utils/git.ts
index 1536fac..94876b1 100644
--- a/node_modules/@astrojs/starlight/utils/git.ts
+++ b/node_modules/@astrojs/starlight/utils/git.ts
@@ -72,6 +72,7 @@ export function getAllNewestCommitDate(rootPath: string, docsPath: string): [str
{
cwd: repoRoot,
encoding: 'utf-8',
+ maxBuffer: 10 * 1024 * 1024,
}
);

11 changes: 10 additions & 1 deletion src/components/overrides/Head.astro
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const NOINDEX_PRODUCTS = ["email-security", "style-guide", "security"];

const currentSection = Astro.url.pathname.split("/")[1].replaceAll(".", "");

const { entry, head } = Astro.locals.starlightRoute;
const { entry, head, lastUpdated } = Astro.locals.starlightRoute;
const frontmatter = entry.data;

const metaTags = [] as Record<string, string>[];
Expand Down Expand Up @@ -126,6 +126,15 @@ if (frontmatter.tags) {
});
}

if (lastUpdated) {
const daysBetween = differenceInCalendarDays(new Date(), lastUpdated);

metaTags.push({
name: "pcx_last_modified",
content: daysBetween.toString(),
});
}

if (frontmatter.updated) {
const daysBetween = differenceInCalendarDays(new Date(), frontmatter.updated);

Expand Down
Loading