More i18n strings and code style fixes.

This commit is contained in:
Fredrik Jonsson 2018-03-01 14:30:56 +01:00
commit f53567394e

View file

@ -21,9 +21,9 @@
{{ $width := (mul ($.Scratch.Get "realwidth") (div (add ($.Scratch.Get "height") 0.0) ($.Scratch.Get "realheight"))) -}}
{{ $.Scratch.Set "width" (int $width) -}}
{{ end -}}
<figure {{ with .Get "class" }}class="{{.}}"{{ end }}>
{{ with .Get "link" }}<a href="{{.}}">{{ end -}}
<img src="{{ $.Get "src" | relURL }}" {{ if or (.Get "alt") (.Get "caption") }}alt="{{ with .Get "alt" }}{{ . }}{{ else }}{{ .Get "caption" }}{{ end }}"{{ end }}{{ with $.Scratch.Get "width" }} width="{{.}}"{{ end }}{{ with $.Scratch.Get "height" }} height="{{.}}"{{ end }}>
<figure {{ with .Get "class" }}class="{{ . }}"{{ end }}>
{{ with .Get "link" }}<a href="{{ . }}">{{ end -}}
<img src="{{ $.Get "src" | relURL }}" {{ if or (.Get "alt") (.Get "caption") }}alt="{{ with .Get "alt" }}{{ . }}{{ else }}{{ .Get "caption" }}{{ end }}"{{ end }}{{ with $.Scratch.Get "width" }} width="{{ . }}"{{ end }}{{ with $.Scratch.Get "height" }} height="{{ . }}"{{ end }}>
{{- if .Get "link" }}</a>{{ end }}
{{ if or (or (.Get "title") (.Get "caption")) (.Get "attr") -}}
<figcaption>{{ if isset .Params "title" }}
@ -31,7 +31,7 @@
{{ if or (.Get "caption") (.Get "attr") -}}
<p>
{{- .Get "caption" -}}
{{ with .Get "attrlink" }} <a href="{{.}}">{{ end }}{{ .Get "attr" }}{{ if .Get "attrlink" }}</a>{{ end -}}
{{ with .Get "attrlink" }} <a href="{{ . }}">{{ end }}{{ .Get "attr" }}{{ if .Get "attrlink" }}</a>{{ end -}}
</p>
{{ end -}}
</figcaption>