]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Docs: simplify a few Hugo `range`s. (#29333)
authorXhmikosR <xhmikosr@gmail.com>
Mon, 2 Sep 2019 09:31:02 +0000 (12:31 +0300)
committerGitHub <noreply@github.com>
Mon, 2 Sep 2019 09:31:02 +0000 (12:31 +0300)
site/content/docs/4.3/content/tables.md
site/content/docs/4.3/utilities/flex.md
site/layouts/shortcodes/example.html

index c79cb81d2c8ce748bf73ffafe626353c4dad80b1..e508d517d6a6f1cc30576fdbe4fac318034f0885 100644 (file)
@@ -770,10 +770,10 @@ Use `.table-responsive{-sm|-md|-lg|-xl}` as needed to create responsive tables u
 **These tables may appear broken until their responsive styles apply at specific viewport widths.**
 
 {{< tables.inline >}}
-{{ range $bp := $.Site.Data.breakpoints }}
-{{ if not (eq $bp "xs") }}
+{{ range $.Site.Data.breakpoints }}
+{{ if not (eq . "xs") }}
 <div class="bd-example">
-  <div class="table-responsive{{ $bp.abbr }}">
+  <div class="table-responsive{{ .abbr }}">
     <table class="table">
       <thead>
         <tr>
@@ -832,9 +832,9 @@ Use `.table-responsive{-sm|-md|-lg|-xl}` as needed to create responsive tables u
 
 {{< highlight html >}}
 {{< tables.inline >}}
-{{- range $bp := $.Site.Data.breakpoints -}}
-{{- if not (eq $bp "xs") }}
-<div class="table-responsive{{ $bp.abbr }}">
+{{- range $.Site.Data.breakpoints -}}
+{{- if not (eq . "xs") }}
+<div class="table-responsive{{ .abbr }}">
   <table class="table">
     ...
   </table>
index 948dfe0610a1adc3b4810221157d64523b8645d0..9ce4f27c5dc8c8f10589ac8df9e82dc59bca7fb0 100644 (file)
@@ -438,8 +438,8 @@ Responsive variations also exist for `order`.
 {{< markdown >}}
 {{< flex.inline >}}
 {{- range $bp := $.Site.Data.breakpoints -}}
-{{- range $i, $num := seq 0 5 }}
-- `.order{{ $bp.abbr }}-{{ $i }}`
+{{- range (seq 0 5) }}
+- `.order{{ $bp.abbr }}-{{ . }}`
 {{- end -}}
 {{- end -}}
 {{< /flex.inline >}}
@@ -450,8 +450,8 @@ Additionally there are also responsive `.order-first` and `.order-last` classes
 {{< markdown >}}
 {{< flex.inline >}}
 {{- range $bp := $.Site.Data.breakpoints -}}
-{{- range $i := slice "first" "last" }}
-- `.order{{ $bp.abbr }}-{{ $i }}`
+{{- range (slice "first" "last") }}
+- `.order{{ $bp.abbr }}-{{ . }}`
 {{- end -}}
 {{- end -}}
 {{< /flex.inline >}}
index bea1d9416a39bf003ebaf2f50480f2b10c6632a0..a13cccca4cc19fbf6b2c5500d514738de472d97f 100644 (file)
@@ -28,7 +28,7 @@
     {{- $modified_content = replace $modified_content "</svg>\n" "</svg>✂️" -}}
     {{- $modified_content = split $modified_content "✂️" -}}
 
-    {{- range $i, $content_chunk := $modified_content -}}
+    {{- range $content_chunk := $modified_content -}}
       {{- $image_class := "" -}}
 
       {{- if (strings.Contains $content_chunk `<svg class="bd-placeholder-img `) -}}