File tree Expand file tree Collapse file tree 2 files changed +19
-12
lines changed
assets/css/docs-nginx-com Expand file tree Collapse file tree 2 files changed +19
-12
lines changed Original file line number Diff line number Diff line change @@ -186,12 +186,18 @@ section {
186
186
display : block
187
187
}
188
188
189
- figure {
189
+ . figure-bitmap {
190
190
border : solid 2px # 42932D ;
191
191
margin-bottom : 10px ;
192
192
display : inline-block;
193
193
max-width : 100% ;
194
- max-height : 100%
194
+ }
195
+
196
+ .figure-svg {
197
+ border : solid 2px # 42932D ;
198
+ margin-bottom : 10px ;
199
+ display : block;
200
+ min-width : 100% ;
195
201
}
196
202
197
203
caption ,
Original file line number Diff line number Diff line change 1
1
< figure {{ with .Get "class" }} class="{{ . }} "{{ end }} >
2
- {{- if .Get "link" -}}
3
- < a href ="{{ .Get "link " }}"{{ with .Get "target" }} target="{{ . }} "{{ end }}{{ with .Get "rel" }} rel="{{ . }} "{{ end }} >
4
- {{- end }}
5
- < img src ="{{ .Get "src " | relURL }}"
6
- {{- if or (.Get "alt") (.Get "caption") }}
7
- alt="{{ with .Get "alt " }}{{ . }}{{ else }}{{ .Get "caption" | markdownify| plainify }}{{ end }}"
8
- {{- end -}}
9
- {{- with .Get "width" }} width="{{ . }} "{{ end -}}
10
- {{- with .Get "height" }} height="{{ . }} "{{ end -}}
11
- /> <!-- Closing img tag -->
2
+ {{- $src := .Get "src" -}}
3
+ {{- $isSVG := strings.HasSuffix $src ".svg" -}}
4
+ < img class ="{{ if $isSVG }}figure-svg{{ else }}figure-bitmap{{ end }} " src ="{{ .Get "src " | relURL }}"
5
+ {{- if or (.Get "alt") (.Get "caption") }}
6
+ alt="{{ with .Get "alt " }}{{ . }}{{ else }}{{ .Get "caption" | markdownify| plainify }}{{ end }}"
7
+ {{- end -}}
8
+ {{- with .Get "width" }} width="{{ . }} "{{ end -}}
9
+ {{- with .Get "height" }} height="{{ . }} "{{ end -}} >
10
+ {{- if and (.Get "link") $isSVG }}
11
+ < a href ="{{ .Get "link " }}"{{ with .Get "target" }} target="{{ . }} "{{ end }}{{ with .Get "rel" }} rel="{{ . }} "{{ end }} >
12
+ {{- end -}}
12
13
{{- if .Get "link" }}</ a > {{ end -}}
13
14
{{- if or (or (.Get "title") (.Get "caption")) (.Get "attr") -}}
14
15
< figcaption >
You can’t perform that action at this time.
0 commit comments