aboutsummaryrefslogtreecommitdiff
path: root/site/layouts
diff options
context:
space:
mode:
authorXhmikosR <[email protected]>2024-03-05 08:12:38 +0200
committerXhmikosR <[email protected]>2024-03-06 09:52:50 +0200
commit2c4e1cd660ee03e1fc9f2804487ae8c567d8d1e3 (patch)
treee3e932e7e12d2454cbdb0b5943c059c10fb84d93 /site/layouts
parent953b4b6c1b67e120235fc19f565444a0f7a97a76 (diff)
downloadbootstrap-2c4e1cd660ee03e1fc9f2804487ae8c567d8d1e3.tar.xz
bootstrap-2c4e1cd660ee03e1fc9f2804487ae8c567d8d1e3.zip
Improve front matter "added" params
Add missing ones and add the ability to show or hide the badge Fixes a few more 404 errors in the version picker
Diffstat (limited to 'site/layouts')
-rw-r--r--site/layouts/_default/docs.html5
-rw-r--r--site/layouts/partials/docs-versions.html6
2 files changed, 6 insertions, 5 deletions
diff --git a/site/layouts/_default/docs.html b/site/layouts/_default/docs.html
index cbf06a554..a71e0f7b5 100644
--- a/site/layouts/_default/docs.html
+++ b/site/layouts/_default/docs.html
@@ -18,8 +18,9 @@
<div class="bd-intro pt-2 ps-lg-2">
<div class="d-md-flex flex-md-row-reverse align-items-center justify-content-between">
<div class="mb-3 mb-md-0 d-flex text-nowrap">
- {{- if .Page.Params.added -}}
- <small class="d-inline-flex px-2 py-1 fw-semibold text-success-emphasis bg-success-subtle border border-success-subtle rounded-2 me-2">Added in v{{ .Page.Params.added }}</small>
+ {{- /* This is needed because we want to show the badge if show_badge isn't present or is set to false */ -}}
+ {{- if (or (and (.Page.Params.added) (not (isset .Page.Params.added "show_badge"))) (and (.Page.Params.added) (isset .Page.Params.added "show_badge") (not (eq .Page.Params.added.show_badge false)))) -}}
+ <small class="d-inline-flex px-2 py-1 fw-semibold text-success-emphasis bg-success-subtle border border-success-subtle rounded-2 me-2">Added in v{{ .Page.Params.added.version }}</small>
{{- end -}}
<a class="btn btn-sm btn-bd-light rounded-2" href="{{ .Site.Params.repo }}/blob/v{{ .Site.Params.current_version }}/site/content/{{ .Page.File.Path | replaceRE `\\` "/" }}" title="View and edit this file on GitHub" target="_blank" rel="noopener">
View on GitHub
diff --git a/site/layouts/partials/docs-versions.html b/site/layouts/partials/docs-versions.html
index a5af0d735..7bb7231ef 100644
--- a/site/layouts/partials/docs-versions.html
+++ b/site/layouts/partials/docs-versions.html
@@ -10,9 +10,9 @@
{{- $versions_link = printf "%s/" $page_slug -}}
{{- end -}}
-{{- $added_in_51 := eq (string .Page.Params.added) "5.1" -}}
-{{- $added_in_52 := eq (string .Page.Params.added) "5.2" -}}
-{{- $added_in_53 := eq (string .Page.Params.added) "5.3" -}}
+{{- $added_in_51 := eq (string .Page.Params.added.version) "5.1" -}}
+{{- $added_in_52 := eq (string .Page.Params.added.version) "5.2" -}}
+{{- $added_in_53 := eq (string .Page.Params.added.version) "5.3" -}}
<li class="nav-item dropdown">
<button type="button" class="btn btn-link nav-link py-2 px-0 px-lg-2 dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false" data-bs-display="static">