Skip to content

Commit

Permalink
[Docs Site] Fix fetch-depth and last updated on pages with updated fm (
Browse files Browse the repository at this point in the history
  • Loading branch information
KianNH authored Jan 8, 2025
1 parent 27cf90b commit 24e9d53
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/publish-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/publish-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions astro.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
12 changes: 12 additions & 0 deletions src/components/overrides/LastUpdated.astro
Original file line number Diff line number Diff line change
@@ -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} />

0 comments on commit 24e9d53

Please sign in to comment.