mirror of
https://github.com/loikein/hugo-tufte.git
synced 2024-11-15 04:46:58 +01:00
45 lines
1.4 KiB
HTML
45 lines
1.4 KiB
HTML
|
{{ $type := .Get "type" }}
|
||
|
|
||
|
{{ if not (eq $type "margin") }}
|
||
|
{{ if eq $type "full" }}
|
||
|
<figure class="fullwidth">
|
||
|
{{ else }}
|
||
|
<figure {{ with .Get "class" }} class="{{ . }}"{{ end }}>
|
||
|
{{ end }}
|
||
|
{{ end }}
|
||
|
|
||
|
{{ if eq $type "full" }}
|
||
|
{{ with .Get "link" }}<a href="{{ . }}">{{ end }}
|
||
|
<img src="{{ .Get "src" }}" {{ with .Get "alt"}}alt="{{ . }}"{{ end }}>
|
||
|
{{ if .Get "link" }}</a>{{ end }}
|
||
|
<figcaption>
|
||
|
{{ else }}
|
||
|
<label for="{{ .Get "label" }}" class="margin-toggle">⊕</label>
|
||
|
<input type="checkbox" id="{{ .Get "label" }}" class="margin-toggle">
|
||
|
<span class="marginnote">
|
||
|
{{ if eq $type "margin" }}
|
||
|
{{ with .Get "link" }}<a href="{{ . }}">{{ end }}
|
||
|
<img src="{{ .Get "src" }}" {{ with .Get "alt"}}alt="{{ . }}"{{ end }}>
|
||
|
{{ if .Get "link" }}</a>{{ end }}
|
||
|
{{ end }}
|
||
|
{{ end }}
|
||
|
{{ with .Get "title"}}<strong>{{ . }} </strong>{{ end}}
|
||
|
{{ with .Get "caption"}}{{ . }}{{ end }}
|
||
|
{{ with .Get "attrlink"}}<a href="{{ .}}">{{ end }}
|
||
|
{{ with .Get "attr" }}{{ . }}{{ end }}
|
||
|
{{ if .Get "attrlink" }}</a>{{ end }}
|
||
|
{{ if eq $type "full" }}
|
||
|
</figcaption>
|
||
|
{{ else }}
|
||
|
</span>
|
||
|
{{ end }}
|
||
|
{{ if and (not (eq $type "full")) (not (eq $type "margin")) }}
|
||
|
{{ with .Get "link" }}<a href="{{ . }}">{{ end }}
|
||
|
<img src="{{ .Get "src" }}" {{ with .Get "alt"}}alt="{{ . }}"{{ end }}>
|
||
|
{{ if .Get "link" }}</a>{{ end }}
|
||
|
{{ end }}
|
||
|
|
||
|
{{ if not (eq $type "margin") }}
|
||
|
</figure>
|
||
|
{{ end }}
|