refactors layouts for head, footer and post
This commit is contained in:
parent
e8e4ba4c3b
commit
e980cbedc8
21 changed files with 93 additions and 61 deletions
|
@ -1,22 +1,21 @@
|
|||
{{ $fig := newScratch }}
|
||||
{{ if .Get "caption" }}
|
||||
{{ $fig.Set "caption" (.Get "caption") }}
|
||||
{{ $fig.Set "caption" (.Get "caption") }}
|
||||
{{ else if .Get "alt" }}
|
||||
{{ $fig.Set "caption" (.Get "alt") }}
|
||||
{{ $fig.Set "caption" (.Get "alt") }}
|
||||
{{ end }}
|
||||
<figure {{ with .Get "class" }}class="{{.}}"{{ end }}>
|
||||
{{ with .Get "link"}}<a href="{{.}}">{{ end }}
|
||||
<img src="{{ .Get "src" }}"
|
||||
{{ with $.Scratch.Get "caption" }}alt="{{ . }}"{{ end }}
|
||||
{{ with .Get "align" }}align="{{ . }}"{{ end }}
|
||||
{{ with .Get "width" }}width="{{ . }}"{{ end }}
|
||||
/>
|
||||
{{ with .Get "link"}}</a>{{ end }}
|
||||
{{ with ($fig.Get "caption") }}
|
||||
{{ with .Get "link"}}<a href="{{.}}">{{ end }}
|
||||
<img src="{{ .Get "src" }}"
|
||||
{{ with $.Scratch.Get "caption" }}alt="{{ . }}"{{ end }}
|
||||
{{ with .Get "align" }}align="{{ . }}"{{ end }}
|
||||
{{ with .Get "width" }}width="{{ . }}"{{ end }} />
|
||||
{{ with .Get "link"}}</a>{{ end }}
|
||||
{{ with ($fig.Get "caption") }}
|
||||
<figcaption>
|
||||
<span class="img--caption">Figure {{ $.Page.Scratch.Get "fig" }}. {{ . }}</span>
|
||||
<span class="img--caption">Figure {{ $.Page.Scratch.Get "fig" }}. {{ . }}</span>
|
||||
</figcaption>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</figure>
|
||||
{{ .Page.Scratch.Add "fig" 1 }}
|
||||
{{ $fig.Delete "caption"}}
|
||||
{{ $fig.Delete "caption"}}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue