Skip to content
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
5 changes: 0 additions & 5 deletions .env.production

This file was deleted.

8 changes: 0 additions & 8 deletions .env.staging

This file was deleted.

47 changes: 8 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 `<https://example.com>` 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 `<link>` and
`<script defer>` tags in every page. The fetch URL lives in `.env.staging`
(used by `pnpm dev`) and `.env.production` (used by `pnpm build`).

`SharedFooter.astro` wraps the injected HTML in a `<div>` with
`data-shared-source`, `data-shared-fragment`, and `data-shared-note`
attributes. Inspect those in DevTools to confirm whether a given build's footer
came from the live fetch (`"live"`) or the local fallback (`"fallback"`).

**About the committed `.env.*` files:** `.env.staging` and `.env.production`
are checked into git on purpose. They contain **only** the three public asset
URLs the integration needs - the same URLs that appear in every rendered page's
`<head>`. They are not secrets and there is nothing in them you couldn't read
from a visitor's browser DevTools. Do not add API keys, tokens, or anything
sensitive to these files. Use `.env` (gitignored) for any local-only overrides.

### Snapshot fallback

If the live fetch fails during a build (origin unreachable, timeout, non-200
response), the build silently uses the on-disk snapshot at
`src/fallback/footer.html` instead of failing. This file is committed and
refreshed manually with:

```bash
pnpm snapshot
git diff src/fallback/
git add src/fallback/
git commit -m "Refresh shared footer snapshot"
```

The build never writes to `src/fallback/` automatically. Refresh when the live
footer has changed meaningfully and you want the safety net to stay roughly
current, or when `data-shared-source="fallback"` shows up on a deployed page.
Styles live in `src/styles/main.css` under `/* Footer */`. The footer repeats
the page's column template (`--page-grid-columns`) so its content lines up with

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My right-nav PR changed the way the central column and right-nav are positioned. I've merged it, so recommend you rebase and check that this positioning rule/comment is still accurate

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the heads up, checked and looks good to me

the article column above it.

## Docs page layout guidelines

Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@
"dev": "npm-run-all --parallel dev:img dev:dictionary dev:astro dev:watch",
"dev:dictionary": "node ./dictionary-sorter.mjs",
"dev:img": "node ./src/themes/octopus/utilities/img.mjs",
"dev:astro": "astro dev --mode staging",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this change?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why astro dev --mode staging existed

It was there purely to serve the microsite footer, and my PR already removes it.

Astro loads .env.[mode] files, so --mode staging made pnpm dev pick up .env.staging — which held only the three shared-footer variables. Its own header comment spells out the purpose:

"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."

So: the footer HTML was fetched at build time from octopus.com/fragments/footer, and the flag let you repoint that fetch at a staging origin to preview footer changes before they went live. It was added in 247ce823e ("Integrate shared footer") — same commit that introduced the fetch.

With the fetch gone, both .env files are deleted and the mode has nothing left to load, so dev:astro is back to plain astro dev.

"dev:astro": "astro dev",
"dev:watch": "onchange 'src/**/*.{js,mjs,ts,astro,css}' -- prettier --write --plugin=prettier-plugin-astro {{changed}}",
"astro": "astro",
"snapshot": "node --env-file=.env.production ./scripts/snapshot-shared.mjs",
"build": "astro build",
"crawl": "linkinator ./dist --skip \"^(?!http://localhost)\" --recurse --verbosity error",
"format": "prettier --write --plugin=prettier-plugin-astro 'src/**/*.{js,mjs,ts,astro,css}'",
Expand Down
25 changes: 0 additions & 25 deletions scripts/snapshot-shared.mjs

This file was deleted.

54 changes: 54 additions & 0 deletions src/components/Footer.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
import { accelerator } from '@lib/accelerator';
import { SITE } from '@config';
import { Lang, Translations } from '@util/Languages';
import { links } from '@data/footer';

const stats = new accelerator.statistics('components/Footer.astro');
stats.start();

// Properties
type Props = {
lang: string;
lastUpdated?: Date | string | null;
};
const { lang, lastUpdated = null } = Astro.props satisfies Props;

// Language
const _ = Lang(lang);

// Logic
const updatedDate = lastUpdated ? new Date(lastUpdated) : null;
const updatedLabel = updatedDate
? `${_(Translations.octopus_footer.last_updated)} ${accelerator.dateFormatter.formatShortDate(updatedDate, lang)}`
: null;
const copyright = `${_(Translations.octopus_footer.copyright)} © ${new Date().getFullYear()} ${SITE.owner}`;

stats.stop();
---

<footer class="site-footer" id="site-footer">
<div class="site-footer__content">
{
updatedDate && (
<p class="site-footer__updated">
<time datetime={updatedDate.toISOString()}>{updatedLabel}</time>
</p>
)
}
<div class="site-footer__meta">
<p class="site-footer__copyright">{copyright}</p>
<nav aria-label={_(Translations.octopus_footer.links_label)}>
<ul class="site-footer__links">
{
links.map((link) => (
<li>
<a href={link.url}>{link.title}</a>
</li>
))
}
</ul>
</nav>
</div>
</div>
</footer>
36 changes: 0 additions & 36 deletions src/components/LastUpdated.astro

This file was deleted.

111 changes: 0 additions & 111 deletions src/components/MarketoForm.astro

This file was deleted.

19 changes: 0 additions & 19 deletions src/components/NewsletterForm.astro

This file was deleted.

29 changes: 0 additions & 29 deletions src/components/SharedFooter.astro

This file was deleted.

5 changes: 0 additions & 5 deletions src/components/SharedScripts.astro

This file was deleted.

6 changes: 6 additions & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
Expand Down
Loading