mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-30 00:29:52 +02:00
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
This commit is contained in:
@@ -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
|
||||
|
@@ -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">
|
||||
|
Reference in New Issue
Block a user