From: XhmikosR Date: Mon, 1 Apr 2024 19:00:09 +0000 (+0300) Subject: docs: move examples inline shortcode to a partial (#39829) X-Git-Tag: v5.3.4~184 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fb4629f82ee768bc52ccb90adf4e35176451e66a;p=thirdparty%2Fbootstrap.git docs: move examples inline shortcode to a partial (#39829) * docs: move examples inline shortcode to a partial * Further tweaks --- diff --git a/site/content/docs/5.3/examples/_index.md b/site/content/docs/5.3/examples/_index.md index 0a08f68e6a..75ea520100 100644 --- a/site/content/docs/5.3/examples/_index.md +++ b/site/content/docs/5.3/examples/_index.md @@ -4,69 +4,3 @@ title: Examples description: Quickly get a project started with any of our examples ranging from using parts of the framework to custom components and layouts. aliases: "/examples/" --- - -{{< list-examples.inline >}} -{{ range $entry := $.Site.Data.examples -}} -
-

{{ $entry.category }}

-

{{ $entry.description }}

- {{ if eq $entry.category "RTL" -}} -
-

- RTL is still experimental and will evolve with feedback. Spotted something or have an improvement to suggest? -

-

Please open an issue.

-
- {{ end -}} - {{ range $i, $example := $entry.examples -}} - {{- $len := len $entry.examples -}} - {{ if (eq $i 0) }}{{ end -}} - {{ end -}} -
-{{ end -}} -{{< /list-examples.inline >}} diff --git a/site/layouts/_default/single.html b/site/layouts/_default/single.html index 427ee76c8d..d0d5e6b5d4 100644 --- a/site/layouts/_default/single.html +++ b/site/layouts/_default/single.html @@ -29,6 +29,7 @@ {{ .Content }} {{ if eq .Title "Examples" -}} + {{ partial "examples/main" . }} {{ partial "examples/bs-themes" . }} {{- end }} diff --git a/site/layouts/partials/examples/main.html b/site/layouts/partials/examples/main.html new file mode 100644 index 0000000000..902f964b45 --- /dev/null +++ b/site/layouts/partials/examples/main.html @@ -0,0 +1,63 @@ +{{ range $entry := $.Site.Data.examples -}} +
+

{{ $entry.category }}

+

{{ $entry.description }}

+ {{ if eq $entry.category "RTL" -}} +
+

+ RTL is still experimental and will evolve with feedback. Spotted something or have an improvement to suggest? +

+

Please open an issue.

+
+ {{ end -}} + {{ range $i, $example := $entry.examples -}} + {{- $len := len $entry.examples -}} + {{ if (eq $i 0) }}
{{ end }} + {{ if $entry.external -}} +
+ +
+

+ + {{ $example.name }} + +

+

{{ $example.description }}

+

+ {{- $indexPath := default "index.html" $example.indexPath -}} + {{- $stackBlitzUrl := printf "%s%s%s" (urls.JoinPath "https://stackblitz.com/github/twbs" $example.url) "?file=" ($indexPath | urlquery) }} + + + Edit in StackBlitz + +

+
+
+ {{ else -}} + + {{- end }} + {{ if (eq (add $i 1) $len) }}
{{ end -}} + {{ end -}} +
+{{ end -}}