Add "Cookie preferences" to the docs About nav (PostHog consent)#2431
Open
clouvet wants to merge 1 commit into
Open
Add "Cookie preferences" to the docs About nav (PostHog consent)#2431clouvet wants to merge 1 commit into
clouvet wants to merge 1 commit into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
landingapp — landing's CI clones this repo intopages/docs/, andlanding'sdocs.html.erbwraps the sharedhtmlshell 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
{ text: "Cookie preferences", cookie_prefs: true }to the firecracker nav's About list._accordion_nav.html.erbspecial-cases it → renders a hidden<a id="footer-cookie-prefs" href="#">(matching the sibling nav links' styling), only whenPOSTHOG_API_KEYis set at build time.landing'sposthog-consent.jsalready un-hides#footer-cookie-prefsand wires it to reopen the banner for in-scope visitors — no new JS here. (A one-linepreventDefaultcompanion is in the landing PR so the<a href="#">doesn't jump.)Dormant until
POSTHOG_API_KEYis 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).