mirror of
https://github.com/naoufalzerai/zerai.xyz.git
synced 2025-12-25 06:53:57 +00:00
change theme again :D
This commit is contained in:
36
themes/notepadium/layouts/shortcodes/figure.html
Normal file
36
themes/notepadium/layouts/shortcodes/figure.html
Normal file
@@ -0,0 +1,36 @@
|
||||
<span{{ with .Get "class" }} class="{{ . }}"{{ else }} class="image-container"{{ end }}>
|
||||
{{- $src := .Get "src" -}}
|
||||
{{- $link := .Get "link" -}}
|
||||
{{- $target := .Get "target" -}}
|
||||
{{- $alt := .Get "alt" -}}
|
||||
{{- $caption := .Get "caption" -}}
|
||||
{{- $title := .Get "title" -}}
|
||||
{{- $attr := .Get "attr" -}}
|
||||
{{- $attrlink := .Get "attrlink" -}}
|
||||
{{- if not $link -}}{{- $link = $src -}}{{- end -}}
|
||||
{{- if not $target -}}{{- $target = "_blank" -}}{{- end -}}
|
||||
<span class="link" ><a href="{{ $link }}"
|
||||
target="{{ $target }}"{{ with .Get "rel" }}
|
||||
rel="{{ . }}"{{ end }}><img class="img" src="{{ $src }}"
|
||||
{{- if or $alt $caption }}
|
||||
alt="{{ with $alt }}{{ . }}{{ else }}{{ $caption | markdownify| plainify }}{{ end }}"
|
||||
{{- end -}}
|
||||
{{- with .Get "width" }} width="{{ . }}"{{ end -}}
|
||||
{{- with .Get "height" }} height="{{ . }}"{{ end -}}
|
||||
/></a></span>
|
||||
{{- if or (or $title $caption) $attr -}}
|
||||
<span class="caption">
|
||||
{{ with $title -}}
|
||||
<span class="title">{{ . }}</span class="image-container-caption">
|
||||
{{- end -}}
|
||||
{{- if or $caption $attr -}}<p>
|
||||
{{- $caption | markdownify -}}
|
||||
{{- with $attrlink }}
|
||||
<a href="{{ . }}">
|
||||
{{- end -}}
|
||||
{{- $attr | markdownify -}}
|
||||
{{- if $attrlink }}</a>{{ end }}</p>
|
||||
{{- end }}
|
||||
</span>
|
||||
{{- end }}
|
||||
</span>
|
||||
Reference in New Issue
Block a user