From 301ed8ae5c0e458db592fb43c942e61764d5996d Mon Sep 17 00:00:00 2001 From: William Laugesen Date: Mon, 10 Aug 2026 12:50:28 +1200 Subject: [PATCH 1/2] Build the footer in this repo instead of importing it The footer came from https://octopus.com/fragments/footer at build time, with CSS and JS loaded from the main site at page-view time. Replace it with an Astro component built to the Figma design, and delete the fetch, the snapshot fallback, and the Marketo forms that only ever rendered inside the imported markup. The nav column now spans the footer row of the content grid, so its divider runs to the bottom of the page as the design shows. Co-Authored-By: Claude Opus 5 (1M context) --- .env.production | 5 - .env.staging | 8 - README.md | 47 +- package.json | 3 +- scripts/snapshot-shared.mjs | 25 - src/components/Footer.astro | 54 ++ src/components/LastUpdated.astro | 36 - src/components/MarketoForm.astro | 111 --- src/components/NewsletterForm.astro | 19 - src/components/SharedFooter.astro | 29 - src/components/SharedScripts.astro | 5 - src/config.ts | 6 + src/data/footer.ts | 179 +---- src/data/language.json | 11 + src/env.d.ts | 9 - src/fallback/footer.html | 740 ------------------ src/layouts/Default.astro | 24 +- src/lib/footerSplitter.ts | 41 - src/lib/sharedNavbarFooter.ts | 74 -- src/styles/main.css | 97 +-- src/styles/vars.css | 2 - src/themes/octopus/components/Copyright.astro | 32 - src/themes/octopus/components/Footer.astro | 41 - .../octopus/components/FooterItem.astro | 43 - src/themes/octopus/components/HtmlHead.astro | 5 - src/themes/octopus/layouts/Default.astro | 10 +- 26 files changed, 147 insertions(+), 1509 deletions(-) delete mode 100644 .env.production delete mode 100644 .env.staging delete mode 100644 scripts/snapshot-shared.mjs create mode 100644 src/components/Footer.astro delete mode 100644 src/components/LastUpdated.astro delete mode 100644 src/components/MarketoForm.astro delete mode 100644 src/components/NewsletterForm.astro delete mode 100644 src/components/SharedFooter.astro delete mode 100644 src/components/SharedScripts.astro delete mode 100644 src/fallback/footer.html delete mode 100644 src/lib/footerSplitter.ts delete mode 100644 src/lib/sharedNavbarFooter.ts delete mode 100644 src/themes/octopus/components/Copyright.astro delete mode 100644 src/themes/octopus/components/Footer.astro delete mode 100644 src/themes/octopus/components/FooterItem.astro diff --git a/.env.production b/.env.production deleted file mode 100644 index e97c0efc41..0000000000 --- a/.env.production +++ /dev/null @@ -1,5 +0,0 @@ -# DO NOT add secrets here - this file is checked into git. -# Production defaults for the shared navbar/footer integration. -FOOTER_FRAGMENT_URL=https://octopus.com/fragments/footer -SHARED_ASSETS_BASE_URL=https://octopus.com/octopus-public/assets -SHARED_ASSETS_ORIGIN=https://octopus.com diff --git a/.env.staging b/.env.staging deleted file mode 100644 index 2353580109..0000000000 --- a/.env.staging +++ /dev/null @@ -1,8 +0,0 @@ -# DO NOT add secrets here - this file is checked into git. -# -# Defaults match production. Edit temporarily to point at staging URLs -# (e.g. https://a.dev.octopus.com/...) when you want to preview upcoming -# shared navbar/footer changes locally before they ship to prod. -FOOTER_FRAGMENT_URL=https://octopus.com/fragments/footer -SHARED_ASSETS_BASE_URL=https://octopus.com/octopus-public/assets -SHARED_ASSETS_ORIGIN=https://octopus.com diff --git a/README.md b/README.md index 82fc6b55ff..28abfad61b 100644 --- a/README.md +++ b/README.md @@ -227,47 +227,16 @@ Within an MDX file, this looks like a code block and will error. Escape the stat MDX files don't allow short-form links, instead of using `` use `[https://example.com](https://example.com)`, or even better - put in useful link text, like `[example website](https://example.com)`. -## Shared footer +## Footer -The footer is not maintained in this repo. It is fetched at build time from the -main site: +The footer is built in this repo by `src/components/Footer.astro`. It renders +the page's last-updated date, the copyright line, and a row of links. Edit the +links in `src/data/footer.ts`; edit the wording in `src/data/language.json` +under `octopus_footer`. -- `https://octopus.com/fragments/footer` - -CSS, JS, and fonts load at page-view time from -`https://octopus.com/octopus-public/assets/...` via `` and -` diff --git a/src/components/NewsletterForm.astro b/src/components/NewsletterForm.astro deleted file mode 100644 index d77b6f94a3..0000000000 --- a/src/components/NewsletterForm.astro +++ /dev/null @@ -1,19 +0,0 @@ ---- -import MarketoForm from './MarketoForm.astro'; - -type Props = { - formId: number; - dreamdataTrackingId?: string; -}; - -const { formId, dreamdataTrackingId } = Astro.props satisfies Props; ---- - - diff --git a/src/components/SharedFooter.astro b/src/components/SharedFooter.astro deleted file mode 100644 index e6c5860211..0000000000 --- a/src/components/SharedFooter.astro +++ /dev/null @@ -1,29 +0,0 @@ ---- -import { fetchFooter } from '../lib/sharedNavbarFooter'; -import { splitFooterAtMarketoPlaceholder } from '../lib/footerSplitter'; -import MarketoForm from './MarketoForm.astro'; - -const footer = await fetchFooter(); -const parts = splitFooterAtMarketoPlaceholder(footer.html); ---- - -
- { - parts.map((part) => - part.kind === 'html' ? ( - - ) : ( -
- -
- ) - ) - } -
diff --git a/src/components/SharedScripts.astro b/src/components/SharedScripts.astro deleted file mode 100644 index c18e3c7d4a..0000000000 --- a/src/components/SharedScripts.astro +++ /dev/null @@ -1,5 +0,0 @@ ---- -import { ASSETS } from '../lib/sharedNavbarFooter'; ---- - - diff --git a/src/config.ts b/src/config.ts index 350c802660..5c6e2dc5a4 100644 --- a/src/config.ts +++ b/src/config.ts @@ -30,6 +30,12 @@ export const SITE: Site = { month: 'long', day: 'numeric', }, + // "Jun 23, 2026" - the footer's last-updated line + shortDateOptions: { + year: 'numeric', + month: 'short', + day: 'numeric', + }, cacheMaxAge: 200, featureFlags: { stickyNav: { top: 112 }, diff --git a/src/data/footer.ts b/src/data/footer.ts index 344145106a..7698560dc3 100644 --- a/src/data/footer.ts +++ b/src/data/footer.ts @@ -1,167 +1,14 @@ -import type { MenuItem } from 'astro-accelerator-utils/types/NavPage'; - -export const menu: (MenuItem | 'categories' | 'tags' | 'toptags')[] = [ - { - title: - '', - order: 1, - }, - { - title: 'Product', - order: 2, - children: [ - { - title: 'Features', - url: 'https://octopus.com/features', - order: 1, - }, - { - title: 'Tenanted deployments', - url: 'https://octopus.com/use-case/tenanted-deployments', - order: 2, - }, - { - title: 'Container deployments', - url: 'https://octopus.com/use-case/container-deployments', - order: 3, - }, - { - title: "What's new", - url: 'https://octopus.com/whatsnew', - order: 4, - }, - { - title: 'Roadmap', - url: 'https://roadmap.octopus.com/tabs/2-planned', - order: 5, - }, - { - title: 'Octopus vs. Azure DevOps', - url: 'https://octopus.com/azure-devops', - order: 6, - }, - { - title: 'Octopus vs. Jenkins', - url: 'https://octopus.com/jenkins', - order: 7, - }, - ], - }, - { - title: 'Learn', - order: 3, - children: [ - { - title: 'Getting started', - url: '/docs/getting-started', - order: 1, - }, - { - title: 'Guides', - url: 'https://octopus.com/docs/guides', - order: 2, - }, - { - title: 'DevOps handbook', - url: 'https://octopus.com/devops/', - order: 3, - }, - { - title: 'Deployments', - url: '/docs/deployment-process', - order: 4, - }, - { - title: 'Runbooks', - url: '/docs/runbooks', - order: 5, - }, - { - title: 'Training videos', - url: 'https://www.youtube.com/playlist?list=PLAGskdGvlaw268i2ZTPC1ZrxwFjjKIdKH', - order: 6, - }, - ], - }, - { - title: 'Help', - order: 4, - children: [ - { - title: 'Contact', - url: 'https://octopus.com/company/contact', - order: 1, - }, - { - title: 'Help and support', - url: 'https://octopus.com/support', - order: 2, - }, - { - title: 'Community', - url: 'https://octopus.com/community', - order: 3, - }, - { - title: 'Discussion forum', - url: 'https://help.octopus.com/', - order: 4, - }, - { - title: 'Upgrade and renew', - url: 'https://octopus.com/upgrade', - order: 5, - }, - ], - }, - { - title: 'About us', - order: 5, - children: [ - { - title: 'Company', - url: 'https://octopus.com/company', - order: 1, - }, - { - title: 'Partners', - url: 'https://octopus.com/partners', - order: 2, - }, - { - title: 'Careers', - url: 'https://octopus.com/company/careers', - order: 3, - }, - { - title: 'Trust center', - url: 'https://octopus.com/company/trust', - order: 4, - }, - { - title: 'Security', - url: 'https://octopus.com/docs/security', - order: 5, - }, - { - title: 'Webinars and events', - url: 'https://octopus.com/events', - order: 6, - }, - { - title: 'Stickers and swag', - url: 'https://shop.octopus.com/', - order: 7, - }, - ], - }, +export type FooterLink = { + title: string; + url: string; +}; + +// Rendered by components/Footer.astro, in this order. +export const links: FooterLink[] = [ + { title: 'Privacy', url: 'https://octopus.com/legal/privacy' }, + { title: 'GDPR', url: 'https://octopus.com/legal/gdpr' }, + { title: 'Terms', url: 'https://octopus.com/legal/customer-agreement' }, + { title: 'Status', url: 'https://status.octopus.com/' }, + { title: 'Support', url: 'https://octopus.com/support' }, + { title: 'Community Slack', url: 'https://oc.to/CommunitySlack' }, ]; - -/* -See navigation.ts -Allows customisation of the footer navigation - -'categories' -> Auto columns of links for categories -'tags' -> Auto columns of links for tags - -*/ diff --git a/src/data/language.json b/src/data/language.json index 3d59270d31..0d074fd80a 100644 --- a/src/data/language.json +++ b/src/data/language.json @@ -17,6 +17,17 @@ "en": "Read more" } }, + "octopus_footer": { + "last_updated": { + "en": "Last updated" + }, + "copyright": { + "en": "Copyright" + }, + "links_label": { + "en": "Legal and support" + } + }, "octopus_github": { "edit_on_github": { "en": "Edit on GitHub" diff --git a/src/env.d.ts b/src/env.d.ts index e843fe904a..acef35f175 100644 --- a/src/env.d.ts +++ b/src/env.d.ts @@ -1,11 +1,2 @@ /// /// - -interface ImportMetaEnv { - readonly FOOTER_FRAGMENT_URL: string; - readonly SHARED_ASSETS_BASE_URL: string; - readonly SHARED_ASSETS_ORIGIN: string; -} -interface ImportMeta { - readonly env: ImportMetaEnv; -} diff --git a/src/fallback/footer.html b/src/fallback/footer.html deleted file mode 100644 index 44861e67e4..0000000000 --- a/src/fallback/footer.html +++ /dev/null @@ -1,740 +0,0 @@ - - - - diff --git a/src/layouts/Default.astro b/src/layouts/Default.astro index e574e748c4..2fc28c559f 100644 --- a/src/layouts/Default.astro +++ b/src/layouts/Default.astro @@ -21,11 +21,9 @@ import Related from '../components/Related.astro'; import ArticleJourney from '../components/ArticleJourney.astro'; import Feedback from '../components/Feedback.astro'; import EditOnGithub from '../components/EditOnGithub.astro'; -import LastUpdated from '../components/LastUpdated.astro'; import CopyMarkdown from '../components/CopyMarkdown.astro'; import Plausible from 'src/components/Plausible.astro'; -import SharedFooter from 'src/components/SharedFooter.astro'; -import SharedScripts from 'src/components/SharedScripts.astro'; +import Footer from 'src/components/Footer.astro'; type Props = { frontmatter: OriginalFrontmatter; @@ -59,6 +57,9 @@ const isSearchPage = accelerator.urlFormatter.formatAddress(Astro.url.pathname) === searchUrl; const showSearch = !isSearchPage; + +// The footer prints this; the article keeps it in its schema.org markup. +const lastUpdated = frontmatter.modDate ?? frontmatter.pubDate ?? null; --- @@ -97,11 +98,6 @@ const showSearch = !isSearchPage; /> - {metaImage && } + { + lastUpdated && ( + + ) + } @@ -122,9 +126,9 @@ const showSearch = !isSearchPage; /> --> +