Skip to content

Commit 24e9d53

Browse files
authored
[Docs Site] Fix fetch-depth and last updated on pages with updated fm (cloudflare#19070)
1 parent 27cf90b commit 24e9d53

File tree

4 files changed

+17
-0
lines changed

4 files changed

+17
-0
lines changed

.github/workflows/publish-preview.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ jobs:
1515
name: Publish Preview
1616
steps:
1717
- uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
1820
- uses: actions/setup-node@v4
1921
with:
2022
node-version: 22.x

.github/workflows/publish-production.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ jobs:
1111
name: Publish Production
1212
steps:
1313
- uses: actions/checkout@v4
14+
with:
15+
fetch-depth: 0
1416
- uses: actions/setup-node@v4
1517
with:
1618
node-version: 22.x

astro.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ export default defineConfig({
152152
Footer: "./src/components/overrides/Footer.astro",
153153
Head: "./src/components/overrides/Head.astro",
154154
Hero: "./src/components/overrides/Hero.astro",
155+
LastUpdated: "./src/components/overrides/LastUpdated.astro",
155156
MarkdownContent: "./src/components/overrides/MarkdownContent.astro",
156157
Sidebar: "./src/components/overrides/Sidebar.astro",
157158
PageSidebar: "./src/components/overrides/PageSidebar.astro",
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
import type { Props } from "@astrojs/starlight/props";
3+
import Default from "@astrojs/starlight/components/LastUpdated.astro";
4+
5+
// Disable lastUpdated in footer if `updated` is present,
6+
// since this will show the date in PageTitle.astro instead.
7+
if (Astro.props.entry.data.updated) {
8+
Astro.props.lastUpdated = undefined;
9+
}
10+
---
11+
12+
<Default {...Astro.props} />

0 commit comments

Comments
 (0)