Skip to content

Commit 42f1167

Browse files
committed
feat: version-aware homepage install card
When the selected Boost version is not the latest, the homepage's tabbed install card collapses to a short paragraph and a teal "See Documentation" CTA inside the same card chrome. Tabs, panels, dropdowns, and the per-option <style> block are skipped entirely. The non-latest signal is selected_version_is_non_latest from the existing selected_version context processor (URL slug -> cookie -> most-recent fallback), so the card flips automatically when the user picks a non-latest release from the navbar dropdown. No view changes needed. The older variant tightens the outer card gap to space-large so the simpler content doesn't leave an awkward vertical gap, and neutralizes the site-wide p { @apply py-5 } on the description.
1 parent 971feab commit 42f1167

2 files changed

Lines changed: 42 additions & 0 deletions

File tree

static/css/v3/install-card.css

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,29 @@
170170

171171
/* Per-option visibility rules are generated by Django in _install_card.html */
172172

173+
/* ── Older-version variant ───────────────────────────────── */
174+
.install-card--older {
175+
gap: var(--space-large);
176+
}
177+
178+
.install-card__older-message {
179+
margin: 0;
180+
/* Override the site-wide `p { @apply py-5 }` from frontend/styles.css */
181+
padding-top: 0;
182+
padding-bottom: 0;
183+
color: var(--color-text-secondary);
184+
font-size: var(--font-size-base);
185+
line-height: var(--line-height-loose);
186+
}
187+
188+
.install-card__older-cta {
189+
display: flex;
190+
}
191+
192+
.install-card__older-cta .btn {
193+
flex: 1 0 0;
194+
}
195+
173196
/* ── Responsive ───────────────────────────────────────────── */
174197
@media (max-width: 767px) {
175198
.install-card__dropdown {

templates/v3/includes/_install_card.html

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,24 @@
3737
{% endcomment %}
3838
{% with resolved_title=title|slugify|default:"install" %}
3939
{% with card_id=card_id|default:resolved_title %}
40+
{% if selected_version_is_non_latest %}
41+
<section class="install-card install-card--older card"
42+
aria-labelledby="{{ card_id }}-heading">
43+
<div class="card__header">
44+
<h2 id="{{ card_id }}-heading" class="card__title install-card__title">
45+
{{ title|default:"Install Boost and get started in your terminal." }}
46+
</h2>
47+
</div>
48+
<div class="install-card__body px-large">
49+
<p class="install-card__older-message">
50+
You are viewing an older version. See the documentation for installation steps.
51+
</p>
52+
<div class="install-card__older-cta">
53+
{% include "v3/includes/_button.html" with label="See Documentation" url="https://www.boost.org/doc/user-guide/getting-started.html" style="teal" aria_label="See documentation for installation steps" only %}
54+
</div>
55+
</div>
56+
</section>
57+
{% else %}
4058
{# Per-option visibility rules (generated from data, complements static rules in install-card.css) #}
4159
<style>
4260
{% for opt in install_card_pkg_managers %}
@@ -131,5 +149,6 @@ <h2 id="{{ card_id }}-heading" class="card__title install-card__title">
131149
</div>
132150
</div>
133151
</section>
152+
{% endif %}
134153
{% endwith %}
135154
{% endwith %}

0 commit comments

Comments
 (0)