Skip to content

Commit b2c46ff

Browse files
committed
feat: improve fallback documentation link and remove dummy fallback
1 parent 57444dc commit b2c46ff

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

ak/homepage.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,14 @@ def build_library_highlight_carousel(limit=3):
196196
for library in libraries:
197197
lv = library_versions.get(library.id)
198198
first_version = library.first_boost_version
199+
# Fall back to the library detail page when the latest release has no
200+
# documentation URL, so the CTA always points somewhere useful.
201+
docs_url = get_documentation_url(lv, latest=True) if lv else ""
202+
if not docs_url:
203+
docs_url = reverse(
204+
"library-detail",
205+
kwargs={"version_slug": "latest", "library_slug": library.slug},
206+
)
199207
slides_by_id[library.id] = {
200208
"name": library.name,
201209
"category_tags": [
@@ -214,7 +222,7 @@ def build_library_highlight_carousel(limit=3):
214222
(lv.description if lv else None) or library.description or ""
215223
),
216224
"added_in_version": (first_version.display_name if first_version else ""),
217-
"docs_url": get_documentation_url(lv, latest=True) if lv else "",
225+
"docs_url": docs_url,
218226
}
219227

220228
if highlighted_ids:

templates/v3/includes/_library_highlight_carousel.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ <h3 class="library-highlight-carousel__name">{{ slide.name }}</h3>
134134
{# Static CTA — one per slide stacked in place, only the active one shown. #}
135135
{% for slide in slides %}
136136
{% with cnt=forloop.counter|stringformat:"s" %}
137-
{% include "v3/includes/_button.html" with label="View documentation" url=slide.docs_url|default:"#" extra_classes="btn-flex library-highlight-carousel__button library-highlight-carousel__button--"|add:cnt %}
137+
{% include "v3/includes/_button.html" with label="View documentation" url=slide.docs_url extra_classes="btn-flex library-highlight-carousel__button library-highlight-carousel__button--"|add:cnt %}
138138
{% endwith %}
139139
{% endfor %}
140140
{% else %}

0 commit comments

Comments
 (0)