Copying layouts from old theme to new
This commit is contained in:
27
layouts/shortcodes/figure.html
Normal file
27
layouts/shortcodes/figure.html
Normal file
@@ -0,0 +1,27 @@
|
||||
<figure class="figure{{ with .Get "class" }} {{ . }}{{ end }}">
|
||||
<a href="{{ .Get "src" }}" class="d-block" data-toggle="lightbox" data-gallery="post-gallery">
|
||||
<img src="{{ .Get "src" }}"
|
||||
{{- if or (.Get "alt") (.Get "caption") }}
|
||||
alt="{{ with .Get "alt" }}{{ . }}{{ else }}{{ .Get "caption" | markdownify| plainify }}{{ end }}"
|
||||
{{- end -}}
|
||||
{{- with .Get "width" }} width="{{ . }}"{{ end -}}
|
||||
{{- with .Get "height" }} height="{{ . }}"{{ end -}}
|
||||
class="figure-img img-fluid"
|
||||
/> <!-- Closing img tag -->
|
||||
</a>
|
||||
{{- if or (or (.Get "title") (.Get "caption")) (.Get "attr") -}}
|
||||
<figcaption class="figure-caption text-center">
|
||||
{{ with (.Get "title") -}}
|
||||
{{ . }}
|
||||
{{- end -}}
|
||||
{{- if or (.Get "caption") (.Get "attr") -}}<p>
|
||||
{{- .Get "caption" | markdownify -}}
|
||||
{{- with .Get "attrlink" }}
|
||||
<a href="{{ . }}">
|
||||
{{- end -}}
|
||||
{{- .Get "attr" | markdownify -}}
|
||||
{{- if .Get "attrlink" }}</a>{{ end }}</p>
|
||||
{{- end }}
|
||||
</figcaption>
|
||||
{{- end }}
|
||||
</figure>
|
||||
Reference in New Issue
Block a user