Component: Archived version banner
Port over logic for displaying the Archived version banner.
On Nanoc, we used the same Vue component for both the survey banner and the archived version banner.
Relevant code:
- Loads the banner: https://gitlab.com/gitlab-org/gitlab-docs/-/blob/main/content/frontend/default/default.js?ref_type=heads#L17
- Logic for whether or not to show the banner: https://gitlab.com/gitlab-org/gitlab-docs/-/blob/main/content/frontend/services/fetch_versions.js#L89
- The banner: https://gitlab.com/gitlab-org/gitlab-docs/-/blob/main/content/frontend/shared/components/docs_banner.vue?ref_type=heads
For Hugo, we could go either way with this (same component vs new component). On Nanoc, both used GlAlert
, but have some different behaviors:
Survey banner | Archive banner |
---|---|
Never shows on an archive site | Only shows on archive sites |
Dismissible | Not dismissible |
Appears in the top of the main content column | Full-width like the navbar |
It does need to be controlled by JS (because we need this function to detect if should appear or not), but maybe using Vue at all is overkill since it doesn't do very much.
Edited by Sarah German