|
1 |
| -{{- $class := .Get "class" -}} |
| 1 | +{{- $_hugo_config := `{ "version": 1 }` -}} |
| 2 | +{{- $col_id := .Get "color" | default .Ordinal -}} |
| 3 | +{{- $height := .Get "height" | default "auto" -}} |
| 4 | +{{- $type := .Get "type" | default "" -}} |
2 | 5 | {{- $style := .Get "style" -}}
|
3 |
| -{{- $id := .Get "id" | default (printf "section-%d" .Ordinal) -}} |
| 6 | +{{- $id_fallback := ( printf "td-block-%d" .Ordinal ) -}} |
| 7 | +{{- $id := .Get "id" | default (printf "%s%s" $id_fallback "-section" ) -}} |
| 8 | +{{- $class := .Get "class" -}} |
4 | 9 | {{- $bg := .Get "background-image" -}}
|
| 10 | +{{- if $bg -}} |
| 11 | + {{- template "shortcodes-blocks_getimage" (dict "name" $bg "ctx" . "target" "bg") }} |
| 12 | +{{- end -}} |
5 | 13 | {{/* special case Kubernetes overview */}}
|
6 | 14 | {{- if eq $class "k8s-overview" -}}
|
7 |
| - {{- partial "kubernetes-overview.html" (dict "id" $id "class" $class "inner" $.Inner ) -}} |
| 15 | + {{- partial "kubernetes-overview.html" (dict "id" $id "class" $class "inner" $.Inner ) -}} |
8 | 16 | {{- else -}}
|
9 |
| -{{- if $bg -}} |
10 |
| - {{ template "shortcodes-blocks_getimage" (dict "name" $bg "ctx" . "target" "bg") }} |
11 |
| -{{- end -}} |
| 17 | +<a id="{{ $id_fallback }}" class="td-offset-anchor"></a> |
12 | 18 | {{- $image := $.Scratch.Get "bg" -}}
|
13 |
| -<section id="{{ $id }}" class="{{ with $image }}section-with-bgimage{{end}} {{ with $class }}{{ . }}{{ end }}" style="{{ with $image }}background-image: url({{ .Permalink }}); {{ end }}{{ with $style }}{{ . | safeCSS }}{{ end }}"> |
14 |
| - {{ $.Inner }} |
| 19 | +<section id="{{ $id }}" class="row td-box td-box--{{ $col_id }} td-box--gradient td-box--height-{{ $height }}{{ with $class }} {{ . }}{{ end }}{{ with $image }} section-with-bgimage {{ end }}" style="{{ with $image }}background-image: url({{ .Permalink }}); {{ end }}{{ with $style }}{{ . | safeCSS }}{{ end }}"> |
| 20 | + <div class="col"> |
| 21 | + <div class="row {{ $type }}"> |
| 22 | + {{ if eq .Page.File.Ext "md" }} |
| 23 | + {{ .Inner | markdownify }} |
| 24 | + {{ else }} |
| 25 | + {{ .Inner | htmlUnescape | safeHTML }} |
| 26 | + {{ end }} |
| 27 | + </div> |
| 28 | + </div> |
15 | 29 | </section>
|
16 | 30 | {{- end -}}
|
0 commit comments