mirror of
https://github.com/loikein/hugo-tufte.git
synced 2024-11-15 04:46:58 +01:00
Add more shortcodes.
This commit is contained in:
parent
8dafca7e01
commit
2c4ac3082f
2 changed files with 45 additions and 0 deletions
44
layouts/shortcodes/figure.html
Normal file
44
layouts/shortcodes/figure.html
Normal file
|
@ -0,0 +1,44 @@
|
|||
{{ $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 }}
|
1
layouts/shortcodes/newthought.html
Normal file
1
layouts/shortcodes/newthought.html
Normal file
|
@ -0,0 +1 @@
|
|||
<span class="newthought">{{ .Inner }}</span>
|
Loading…
Reference in a new issue