diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2018-05-04 17:53:56 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2018-05-04 23:12:10 +0200 |
commit | 34ad9a4f178fcf50abe7246ad9d30b294327da16 (patch) | |
tree | 897c9094913420fb1bb6a413332f946d298b8d4f /tpl/tplimpl/embedded/templates/shortcodes/figure.html | |
parent | 914cc85e22af2e6c28f24a5fc70de94e4b9f1b1b (diff) |
tpl/tplimpl: Extract internal templates
Having them in separate files should make maintainance easier.
When adding new or making changes to the templates:
```bash
mage generate
```
This will get the Go code in sync.
Fixes #4457
Diffstat (limited to 'tpl/tplimpl/embedded/templates/shortcodes/figure.html')
-rwxr-xr-x | tpl/tplimpl/embedded/templates/shortcodes/figure.html | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tpl/tplimpl/embedded/templates/shortcodes/figure.html b/tpl/tplimpl/embedded/templates/shortcodes/figure.html new file mode 100755 index 000000000..258d25bfe --- /dev/null +++ b/tpl/tplimpl/embedded/templates/shortcodes/figure.html @@ -0,0 +1,18 @@ +<!-- image --> +<figure{{ with .Get "class" }} class="{{.}}"{{ end }}> + {{ if .Get "link"}}<a href="{{ .Get "link" }}"{{ with .Get "target" }} target="{{ . }}"{{ end }}{{ with .Get "rel" }} rel="{{ . }}"{{ end }}>{{ end }} + <img src="{{ .Get "src" }}" {{ if or (.Get "alt") (.Get "caption") }}alt="{{ with .Get "alt"}}{{.}}{{else}}{{ .Get "caption" }}{{ end }}" {{ end }}{{ with .Get "width" }}width="{{.}}" {{ end }}{{ with .Get "height" }}height="{{.}}" {{ end }}/> + {{ if .Get "link"}}</a>{{ end }} + {{ if or (or (.Get "title") (.Get "caption")) (.Get "attr")}} + <figcaption>{{ if isset .Params "title" }} + <h4>{{ .Get "title" }}</h4>{{ end }} + {{ if or (.Get "caption") (.Get "attr")}}<p> + {{ .Get "caption" }} + {{ with .Get "attrlink"}}<a href="{{.}}"> {{ end }} + {{ .Get "attr" }} + {{ if .Get "attrlink"}}</a> {{ end }} + </p> {{ end }} + </figcaption> + {{ end }} +</figure> +<!-- image -->
\ No newline at end of file |