Compare commits
2 commits
4e4e64d5b2
...
d35fec4c78
Author | SHA1 | Date | |
---|---|---|---|
d35fec4c78 | |||
7d9ad73c0b |
2 changed files with 21 additions and 10 deletions
|
@ -1,16 +1,27 @@
|
|||
{{ $img := $.Page.Resources.GetMatch (.Get "src")}}
|
||||
{{ $name_splitted := split $img.RelPermalink "." }}
|
||||
{{ $name_base := index $name_splitted 0 }}
|
||||
{{ $ext_base := index $name_splitted 1 }}
|
||||
<figure {{ with .Get "class" }} class="{{ . }}"{{ end }}>
|
||||
{{ with .Get "link" }}
|
||||
<a href="{{ . | absURL }}">
|
||||
{{ else }}
|
||||
<a href="{{ $img.RelPermalink }}">
|
||||
{{ end }}
|
||||
<picture>
|
||||
{{ if ( in "svg ico gif" $ext_base ) }}
|
||||
<img src="{{ $img.RelPermalink }}"
|
||||
{{ with .Get "alt"}} alt="{{ . }}"{{ end }}
|
||||
{{ with .Get "title"}} title="{{ . }}"{{ end }}
|
||||
{{ with .Get "height"}} height="{{ . }}"{{ end }}
|
||||
{{ with .Get "width"}} width="{{ . }}"{{ end }} />
|
||||
{{ with .Get "link" }}
|
||||
</a>
|
||||
{{ with .Get "title"}} title="{{ . }}"{{ end }}/>
|
||||
{{ else }}
|
||||
<source srcset="{{ $name_base }}.thumb.avif" type="image/avif"/>
|
||||
<source srcset="{{ $name_base }}.thumb.webp" type="image/webp"/>
|
||||
<img src="{{ $name_base }}.thumb.{{ $ext_base }}"
|
||||
{{ with .Get "alt"}} alt="{{ . }}"{{ end }}
|
||||
{{ with .Get "title"}} title="{{ . }}"{{ end }}/>
|
||||
{{ end }}
|
||||
</picture>
|
||||
</a>
|
||||
{{ if .Get "caption" }}
|
||||
<figcaption>
|
||||
<p>{{ .Get "caption" }}
|
||||
|
|
|
@ -547,11 +547,11 @@ a:focus {
|
|||
}
|
||||
.article-body figure.half {
|
||||
width: 100%;
|
||||
max-width: 50%;
|
||||
max-width: 45%;
|
||||
}
|
||||
.article-body figure.third {
|
||||
width: 100%;
|
||||
max-width: 33.33%;
|
||||
max-width: 30%;
|
||||
}
|
||||
.article-body figure.logo img {
|
||||
width: 100px;
|
||||
|
|
Loading…
Reference in a new issue