aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Déramond <[email protected]>2023-03-24 15:00:58 +0100
committerGitHub <[email protected]>2023-03-24 16:00:58 +0200
commit0653e7f648831be10ec3c9be635e6c0ebfe0de13 (patch)
treeb314d48ff682a1703fd968d31d0e0fe96f320de5
parente8730484b8f0ad0458da7ff52ab5ebf55d60b693 (diff)
downloadbootstrap-0653e7f648831be10ec3c9be635e6c0ebfe0de13.tar.xz
bootstrap-0653e7f648831be10ec3c9be635e6c0ebfe0de13.zip
Fix reference to twbs/examples/icons-font + fine-tune index.html SB location target (#38310)
* Fix reference to twbs/examples/icons-font + fine-tune index.html SB location target * Use urlquery * Add `rel="noopener"` --------- Co-authored-by: XhmikosR <[email protected]>
-rw-r--r--.cspell.json1
-rw-r--r--site/content/docs/5.3/examples/_index.md8
-rw-r--r--site/data/examples.yml5
3 files changed, 11 insertions, 3 deletions
diff --git a/.cspell.json b/.cspell.json
index 752acd521..e477ef83d 100644
--- a/.cspell.json
+++ b/.cspell.json
@@ -108,6 +108,7 @@
"unstyled",
"Uppercased",
"urlize",
+ "urlquery",
"vbtn",
"viewports",
"Vite",
diff --git a/site/content/docs/5.3/examples/_index.md b/site/content/docs/5.3/examples/_index.md
index 4ab6ffe5b..2fa9a4528 100644
--- a/site/content/docs/5.3/examples/_index.md
+++ b/site/content/docs/5.3/examples/_index.md
@@ -26,13 +26,17 @@ aliases: "/examples/"
<svg class="bi fs-5 flex-shrink-0 mt-1"><use xlink:href="#box-seam"></use></svg>
<div>
<h3 class="h5 mb-1">
- <a class="d-block link-offset-1" href="{{ $.Site.Params.github_org }}{{ $example.url }}/" target="_blank">
+ <a class="d-block link-offset-1" href="{{ $.Site.Params.github_org }}{{ $example.url }}/" target="_blank" rel="noopener">
{{ $example.name }}
</a>
</h3>
<p class="text-body-secondary">{{ $example.description }}</p>
<p>
- <a class="icon-link small link-secondary link-offset-1" href="https://stackblitz.com/github/twbs{{ $example.url }}?file=index.html" target="_blank">
+ {{- $htmlIndexLocation := "index.html" -}}
+ {{- if $example.htmlIndexLocation -}}
+ {{- $htmlIndexLocation = printf "%s/index.html" $example.htmlIndexLocation -}}
+ {{- end }}
+ <a class="icon-link small link-secondary link-offset-1" href="https://stackblitz.com/github/twbs{{ $example.url }}?file={{ $htmlIndexLocation | urlquery }}" target="_blank" rel="noopener">
<svg class="bi flex-shrink-0"><use xlink:href="#lightning-charge-fill"></use></svg>
Edit in StackBlitz
</a>
diff --git a/site/data/examples.yml b/site/data/examples.yml
index 017aaa7c5..4b85c57b1 100644
--- a/site/data/examples.yml
+++ b/site/data/examples.yml
@@ -14,15 +14,18 @@
- name: Webpack
description: "Import and bundle Bootstrap's source Sass and JavaScript with Webpack."
url: /examples/tree/main/webpack
+ htmlIndexLocation: src
- name: Parcel
description: "Import and bundle Bootstrap's source Sass and JavaScript via Parcel."
url: /examples/tree/main/parcel
+ htmlIndexLocation: src
- name: Vite
description: "Import and bundle Bootstrap's source Sass and JavaScript with Vite."
url: /examples/tree/main/vite
+ htmlIndexLocation: src
- name: Bootstrap Icons
description: "Import and compile Bootstrap's Sass with Stylelint, PurgeCSS, and the Bootstrap Icons web font."
- url: /examples/tree/main/bootstrap-icons
+ url: /examples/tree/main/icons-font
- category: Snippets
description: "Common patterns for building sites and apps that build on existing components and utilities with custom CSS and more."