]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Improve front matter "added" params
authorXhmikosR <xhmikosr@gmail.com>
Tue, 5 Mar 2024 06:12:38 +0000 (08:12 +0200)
committerXhmikosR <xhmikosr@gmail.com>
Wed, 6 Mar 2024 07:52:50 +0000 (09:52 +0200)
Add missing ones and add the ability to show or hide the badge

Fixes a few more 404 errors in the version picker

16 files changed:
site/content/docs/5.3/components/placeholders.md
site/content/docs/5.3/customize/color-modes.md
site/content/docs/5.3/getting-started/contribute.md
site/content/docs/5.3/getting-started/vite.md
site/content/docs/5.3/helpers/color-background.md
site/content/docs/5.3/helpers/focus-ring.md
site/content/docs/5.3/helpers/icon-link.md
site/content/docs/5.3/helpers/stacks.md
site/content/docs/5.3/helpers/vertical-rule.md
site/content/docs/5.3/layout/css-grid.md
site/content/docs/5.3/utilities/link.md
site/content/docs/5.3/utilities/object-fit.md
site/content/docs/5.3/utilities/opacity.md
site/content/docs/5.3/utilities/z-index.md
site/layouts/_default/docs.html
site/layouts/partials/docs-versions.html

index 8317b11846557f118297437f1d8833585f1d996b..4014b1e9c195e41fdf5d049fbf8c04e961550eae 100644 (file)
@@ -4,7 +4,8 @@ title: Placeholders
 description: Use loading placeholders for your components or pages to indicate something may still be loading.
 group: components
 toc: true
-added: "5.1"
+added:
+  version: "5.1"
 ---
 
 ## About
index 945d5ec336c09b7027f9e6bbc021a7a43ef250fe..ea6db289014aef47cde8b9eee0114eae9dc3faa2 100644 (file)
@@ -4,7 +4,8 @@ title: Color modes
 description: Bootstrap now supports color modes, or themes, as of v5.3.0. Explore our default light color mode and the new dark mode, or create your own using our styles as your template.
 group: customize
 toc: true
-added: "5.3"
+added:
+  version: "5.3"
 ---
 
 {{< callout >}}
index 3b517bd9c504f3b78fa52a35b005f1bd21cb1a81..5ab3f0aa371ea6e311652b01b4dbb609f60c0d4f 100644 (file)
@@ -5,6 +5,9 @@ description: Help develop Bootstrap with our documentation build scripts and tes
 group: getting-started
 toc: true
 aliases: "/docs/5.3/getting-started/build-tools/"
+added:
+  show_badge: false
+  version: "5.1"
 ---
 
 ## Tooling setup
index 33b76d3df6a20259fab1946237daae95cd47c6de..653d7a9c5a3b3a99a2dc6052b65c1ce6bfac7863 100644 (file)
@@ -5,6 +5,9 @@ description: The official guide for how to include and bundle Bootstrap's CSS an
 group: getting-started
 toc: true
 thumbnail: guides/bootstrap-vite@2x.png
+added:
+  show_badge: false
+  version: "5.2"
 ---
 
 <img class="mb-4 img-fluid rounded-3" srcset="/docs/{{< param docs_version >}}/assets/img/guides/bootstrap-vite.png, /docs/{{< param docs_version >}}/assets/img/guides/bootstrap-vite@2x.png 2x" src="/docs/{{< param docs_version >}}/assets/img/guides/bootstrap-vite.png" width="2000" height="1000" alt="">
index d64ca4339106c6a13d4712815ad9fa5ef556f815..780662e964a12e7962eee4b43434dc78d0361d3b 100644 (file)
@@ -4,7 +4,8 @@ title: Color and background
 description: Set a background color with contrasting foreground color.
 group: helpers
 toc: true
-added: "5.2"
+added:
+  version: "5.2"
 ---
 
 ## Overview
index fa36bf8ce0c72d7c86c24126d7221a57819a337d..5a4e0f0fafe44be3764162cf003551a5afdca148 100644 (file)
@@ -4,7 +4,8 @@ title: Focus ring
 description: Utility classes that allows you to add and modify custom focus ring styles to elements and components.
 group: helpers
 toc: true
-added: "5.3"
+added:
+  version: "5.3"
 ---
 
 The `.focus-ring` helper removes the default `outline` on `:focus`, replacing it with a `box-shadow` that can be more broadly customized. The new shadow is made up of a series of CSS variables, inherited from the `:root` level, that can be modified for any element or component.
index ec63c5b8c889f6b62aad54ca529d0bf559bcba3e..1e5cc8b127d334e98d68d9a799012ad3a85b257f 100644 (file)
@@ -4,7 +4,8 @@ title: Icon link
 description: Quickly create stylized hyperlinks with Bootstrap Icons or other icons.
 group: helpers
 toc: true
-added: 5.3
+added:
+  version: "5.3"
 ---
 
 The icon link helper component modifies our default link styles to enhance their appearance and quickly align any pairing of icon and text. Alignment is set via inline flexbox styling and a default `gap` value. We stylize the underline with a custom offset and color. Icons are automatically sized to `1em` to best match their associated text's `font-size`.
index ffe434188b6aabb2ee62d3112f95c151435d570c..f85a7533ea66d6dff34c1b85dd09c45cbb768676 100644 (file)
@@ -4,7 +4,8 @@ title: Stacks
 description: Shorthand helpers that build on top of our flexbox utilities to make component layout faster and easier than ever.
 group: helpers
 toc: true
-added: "5.1"
+added:
+  version: "5.1"
 ---
 
 Stacks offer a shortcut for applying a number of flexbox properties to quickly and easily create layouts in Bootstrap. All credit for the concept and implementation goes to the open source [Pylon project](https://almonk.github.io/pylon/).
index 130f97b8a680f5ff94aece1d43f300338862e9ac..9e5981f22665ee65e7cccb1ae2c554b3b97a1be5 100644 (file)
@@ -4,7 +4,8 @@ title: Vertical rule
 description: Use the custom vertical rule helper to create vertical dividers like the `<hr>` element.
 group: helpers
 toc: true
-added: "5.1"
+added:
+  version: "5.1"
 ---
 
 ## How it works
index 397733c8a2f751685b8cce4f927982901226d967..c79c4ce0f40620e04a7a92e5740fc1628cd2b100 100644 (file)
@@ -4,7 +4,8 @@ title: CSS Grid
 description: Learn how to enable, use, and customize our alternate layout system built on CSS Grid with examples and code snippets.
 group: layout
 toc: true
-added: "5.1"
+added:
+  version: "5.1"
 ---
 
 Bootstrap's default grid system represents the culmination of over a decade of CSS layout techniques, tried and tested by millions of people. But, it was also created without many of the modern CSS features and techniques we're seeing in browsers like the new CSS Grid.
index 668af8c23765987d809fe9f30568bcc26e23e970..2623f8029e8ff4ba3cca77c7af6de37b221bf3ce 100644 (file)
@@ -4,7 +4,8 @@ title: Link
 description: Link utilities are used to stylize your anchors to adjust their color, opacity, underline offset, underline color, and more.
 group: utilities
 toc: true
-added: 5.3
+added:
+  version: "5.3"
 ---
 
 ## Link opacity
index babc70a697a2883238fcfa1674058d9ba91a5813..732a8fec98a305c159daa440a71e4ee63e0f6a81 100644 (file)
@@ -4,6 +4,8 @@ title: Object fit
 description: Use the object fit utilities to modify how the content of a [replaced element](https://developer.mozilla.org/en-US/docs/Web/CSS/Replaced_element), such as an `<img>` or `<video>`, should be resized to fit its container.
 group: utilities
 toc: true
+added:
+  version: "5.3"
 ---
 
 ## How it works
index 891b46b8fb398408becc64bc819fc94c91eb579f..1cf4696cc1ac54912b5e31c8619a6218cdfd33a4 100644 (file)
@@ -3,7 +3,8 @@ layout: docs
 title: Opacity
 description: Control the opacity of elements.
 group: utilities
-added: "5.1"
+added:
+  version: "5.1"
 ---
 
 The `opacity` property sets the opacity level for an element. The opacity level describes the transparency level, where `1` is not transparent at all, `.5` is 50% visible, and `0` is completely transparent.
index 64ed84bcec56a8e4918ccfb254277f3382bb7ff6..80b8dba927e33ae02d51d2f41e150c9a274649c6 100644 (file)
@@ -4,7 +4,8 @@ title: Z-index
 description: Use our low-level `z-index` utilities to quickly change the stack level of an element or component.
 group: utilities
 toc: true
-added: "5.3"
+added:
+  version: "5.3"
 ---
 
 ## Example
index cbf06a554f697bd4db1a942cc92932c739ab059a..a71e0f7b54fd40bb99f39c57690d9fe0bf9a574b 100644 (file)
@@ -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
index a5af0d7350d1621c11f138871de317bcd6de800c..7bb7231ef3ae43e71625acc566810613786f2d94 100644 (file)
@@ -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">