Skip to content

Add "Cookie preferences" to the docs About nav (PostHog consent)#2431

Open
clouvet wants to merge 1 commit into
mainfrom
posthog-marketing-analytics
Open

Add "Cookie preferences" to the docs About nav (PostHog consent)#2431
clouvet wants to merge 1 commit into
mainfrom
posthog-marketing-analytics

Conversation

@clouvet

@clouvet clouvet commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Adds a "Cookie preferences" control to the docs left-nav About section (next to Privacy Policy / Terms of Service), so EEA/UK visitors can reopen the PostHog consent banner and withdraw consent from docs pages.

Why this is the only docs-repo change needed

Docs pages are rendered by the landing app — landing's CI clones this repo into pages/docs/, and landing's docs.html.erb wraps the shared html shell layout. That shell already loads PostHog (bundled consent script + banner) via superfly/landing#1165. So docs pages already track + show the banner; the one thing missing was the withdraw control, because docs has no footer (where ui-ex/landing put it).

What it does

  • Adds { text: "Cookie preferences", cookie_prefs: true } to the firecracker nav's About list.
  • _accordion_nav.html.erb special-cases it → renders a hidden <a id="footer-cookie-prefs" href="#"> (matching the sibling nav links' styling), only when POSTHOG_API_KEY is set at build time.
  • landing's posthog-consent.js already un-hides #footer-cookie-prefs and wires it to reopen the banner for in-scope visitors — no new JS here. (A one-line preventDefault companion is in the landing PR so the <a href="#"> doesn't jump.)

Dormant until POSTHOG_API_KEY is set at build. Copy/consent behavior identical to the other surfaces.

Companion: superfly/landing#1165 (the actual PostHog integration; this just adds the docs withdraw link).

Docs pages are rendered by the landing app (landing clones this repo into pages/docs
and its docs layout wraps the shared shell), so they already load PostHog via #1165 —
but docs has no footer for the "Cookie preferences" withdraw control. Add it to the
firecracker nav's About section (next to Privacy Policy / Terms) as a hidden
`#footer-cookie-prefs` anchor that posthog-consent.js un-hides + wires for in-scope
visitors. Rendered only when POSTHOG_API_KEY is set at build time.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant