Skip to content

Comments

[Site] Restructure footer so semantic footer is within it#28093

Merged
kodster28 merged 3 commits intoproductionfrom
footer-reorg
Feb 9, 2026
Merged

[Site] Restructure footer so semantic footer is within it#28093
kodster28 merged 3 commits intoproductionfrom
footer-reorg

Conversation

@kodster28
Copy link
Collaborator

Summary

We have footer content that's actually outside the footer container. Updating our override to account for this.

@kodster28 kodster28 requested a review from a team as a code owner February 4, 2026 19:25
@github-actions github-actions bot added the size/m label Feb 4, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2026

This pull request requires reviews from CODEOWNERS as it changes files that match the following patterns:

Pattern Owners
*.astro @cloudflare/content-engineering, @kodster28
*.ts @cloudflare/content-engineering, @kodster28

@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2026

@elithrar
Copy link
Collaborator

elithrar commented Feb 6, 2026

/bonk review this PR for @kodster28

@ask-bonk
Copy link
Contributor

ask-bonk bot commented Feb 6, 2026

Now I have a complete understanding of the changes. Let me write up the review.


PR Review: [Site] Restructure footer so semantic footer is within it

Summary of Changes

src/components/overrides/Footer.astro (+90/-60): The core of the PR. Previously, the Footer override component rendered the custom Cloudflare footer content (link groups, copyright, etc.) outside of the <footer> element -- it imported and rendered the default Starlight <Default /> (which contains the <footer> tag) as a sibling, with the custom content alongside it. Now, everything is wrapped inside a single <footer class="sl-flex"> element that the component owns directly.

Key structural changes:

  • Removed: import Default from "@astrojs/starlight/components/Footer.astro" and the {!splash && <Default />} usage.
  • Added: Explicit imports of the sub-components that Default was rendering internally: EditLink, LastUpdated, and Pagination (via virtual:starlight/components/* modules).
  • The custom Cloudflare footer section, the Starlight meta section (pagination + edit link + last updated), and the feedback prompt are all now children of a single <footer> element.
  • Styles updated: :global(footer:not(.DocSearch-Footer)) selector replaced with a simpler scoped footer selector. The .meta override no longer needs :global() wrapping. Added explicit padding/margin to .starlight-footer-section and .feedback-prompt since the layout is now self-contained.

src/starlight-modules.d.ts (+17, new file): Adds TypeScript type declarations for the three virtual:starlight/components/* modules now imported directly. Without this, TS would complain about unresolved modules.

Feedback

Overall: This looks good. The motivation is clear and the approach is sound.

A few observations:

  1. Semantic correctness: The whole point of this PR is well-justified. Having footer content visually appearing in the footer but semantically outside the <footer> landmark is an accessibility issue. Wrapping everything in a single <footer> is the right call.

  2. Type declarations file (src/starlight-modules.d.ts): This is fine and necessary given the virtual module imports. It's automatically included via the "include": [".astro/types.d.ts", "**/*"] in tsconfig.json, so no config changes are needed.

    One minor note: the type references like typeof import("@astrojs/starlight/components/EditLink.astro").default assume the shape of Starlight's internal component exports. These could break on a Starlight major version upgrade, but that's inherent to overriding framework internals and is acceptable for this use case.

  3. :global() removal: The old code needed :global(footer:not(.DocSearch-Footer)) because the footer element was rendered by the imported Default component (outside the scope of this component's styles). Now that the <footer> is directly in this component's template, the scoped footer selector works naturally. Clean improvement.

  4. Hardcoded copyright year: Line 115 has © 2026 Cloudflare, Inc. -- this was already present before the PR so it's not a regression, but worth noting it'll need a manual bump each year. Not something to block this PR on.

  5. Discord link uses HTTP: Line 50 has http://discord.cloudflare.com/ -- again, pre-existing and not introduced by this PR.

No blocking issues found. The restructuring is well-scoped, the styles are appropriately simplified, and the new type declarations are correct.

github run

@kodster28 kodster28 merged commit 62bd515 into production Feb 9, 2026
9 checks passed
@kodster28 kodster28 deleted the footer-reorg branch February 9, 2026 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants