Skip to content

Commit

Permalink
Improve front matter "added" params
Browse files Browse the repository at this point in the history
Add missing ones and add the ability to show or hide the badge

Fixes a few more 404 errors in the version picker
  • Loading branch information
XhmikosR committed Mar 5, 2024
1 parent 7032620 commit 26b4636
Show file tree
Hide file tree
Showing 16 changed files with 35 additions and 16 deletions.
3 changes: 2 additions & 1 deletion site/content/docs/5.3/components/placeholders.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion site/content/docs/5.3/customize/color-modes.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 >}}
Expand Down
3 changes: 3 additions & 0 deletions site/content/docs/5.3/getting-started/contribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions site/content/docs/5.3/getting-started/vite.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
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/[email protected] 2x" src="/docs/{{< param docs_version >}}/assets/img/guides/bootstrap-vite.png" width="2000" height="1000" alt="">
Expand Down
3 changes: 2 additions & 1 deletion site/content/docs/5.3/helpers/color-background.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion site/content/docs/5.3/helpers/focus-ring.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 2 additions & 1 deletion site/content/docs/5.3/helpers/icon-link.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down
3 changes: 2 additions & 1 deletion site/content/docs/5.3/helpers/stacks.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/).
Expand Down
3 changes: 2 additions & 1 deletion site/content/docs/5.3/helpers/vertical-rule.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion site/content/docs/5.3/layout/css-grid.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 2 additions & 1 deletion site/content/docs/5.3/utilities/link.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions site/content/docs/5.3/utilities/object-fit.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion site/content/docs/5.3/utilities/opacity.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 2 additions & 1 deletion site/content/docs/5.3/utilities/z-index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions site/layouts/_default/docs.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ <h5 class="offcanvas-title" id="bdSidebarOffcanvasLabel">Browse docs</h5>
<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>
{{- 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
Expand Down
6 changes: 3 additions & 3 deletions site/layouts/partials/docs-versions.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
{{- $versions_link = urls.JoinPath $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">
Expand Down

0 comments on commit 26b4636

Please sign in to comment.