mirror of
https://github.com/cloudflare/cloudflare-docs.git
synced 2026-01-11 20:06:58 +00:00
[Docs Site] Fix fetch-depth and last updated on pages with updated fm (#19070)
This commit is contained in:
parent
27cf90bd40
commit
24e9d533dc
4 changed files with 17 additions and 0 deletions
2
.github/workflows/publish-preview.yml
vendored
2
.github/workflows/publish-preview.yml
vendored
|
|
@ -15,6 +15,8 @@ jobs:
|
|||
name: Publish Preview
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 22.x
|
||||
|
|
|
|||
2
.github/workflows/publish-production.yml
vendored
2
.github/workflows/publish-production.yml
vendored
|
|
@ -11,6 +11,8 @@ jobs:
|
|||
name: Publish Production
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 22.x
|
||||
|
|
|
|||
|
|
@ -152,6 +152,7 @@ export default defineConfig({
|
|||
Footer: "./src/components/overrides/Footer.astro",
|
||||
Head: "./src/components/overrides/Head.astro",
|
||||
Hero: "./src/components/overrides/Hero.astro",
|
||||
LastUpdated: "./src/components/overrides/LastUpdated.astro",
|
||||
MarkdownContent: "./src/components/overrides/MarkdownContent.astro",
|
||||
Sidebar: "./src/components/overrides/Sidebar.astro",
|
||||
PageSidebar: "./src/components/overrides/PageSidebar.astro",
|
||||
|
|
|
|||
12
src/components/overrides/LastUpdated.astro
Normal file
12
src/components/overrides/LastUpdated.astro
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
---
|
||||
import type { Props } from "@astrojs/starlight/props";
|
||||
import Default from "@astrojs/starlight/components/LastUpdated.astro";
|
||||
|
||||
// Disable lastUpdated in footer if `updated` is present,
|
||||
// since this will show the date in PageTitle.astro instead.
|
||||
if (Astro.props.entry.data.updated) {
|
||||
Astro.props.lastUpdated = undefined;
|
||||
}
|
||||
---
|
||||
|
||||
<Default {...Astro.props} />
|
||||
Loading…
Add table
Reference in a new issue