Dark mode (#66)
This commit is contained in:
parent
5eff47c68b
commit
59be9a504f
50 changed files with 1527 additions and 1154 deletions
|
@ -1,4 +1,4 @@
|
|||
{{ $source := ($.Page.Resources.ByType "image").GetMatch (printf "*%s*" (.Get "name")) }}
|
||||
{{ $source := ($.Page.Resources.ByType "image").GetMatch (printf "%s" (.Get "name")) }}
|
||||
{{ $customAlt := .Get "alt" }}
|
||||
{{ $customSize := .Get "size" }}
|
||||
{{ $lazyLoad := default (default true $.Site.Params.GeekdocImageLazyLoading) (.Get "lazy") }}
|
||||
|
@ -16,21 +16,19 @@
|
|||
<div class="flex justify-center">
|
||||
<figure class="gdoc-markdown__figure">
|
||||
<a class="gdoc-markdown__link--raw" href="{{ .RelPermalink }}">
|
||||
<img
|
||||
{{ if $lazyLoad }}loading="lazy"{{ end }}
|
||||
{{ with $customSize }}
|
||||
src="{{ index $size $customSize }}" alt="{{ $caption }}"
|
||||
{{ else }}
|
||||
srcset="{{ $size.tiny }} 320w,
|
||||
{{ $size.small }} 600w,
|
||||
{{ $size.medium }} 1200w,
|
||||
{{ $size.large }} 2x"
|
||||
sizes="(max-width: 320px) 320w,
|
||||
(max-width: 600px) 600w,
|
||||
(max-width: 1200px) 1200w,
|
||||
2x"
|
||||
src="{{ $size.large }}" alt="{{ $caption }}"
|
||||
{{ end }}/>
|
||||
<picture>
|
||||
<source
|
||||
{{ with $customSize }}
|
||||
srcset="{{ index $size $customSize }}"
|
||||
{{ else }}
|
||||
srcset="{{ $size.small }} 600w,
|
||||
{{ $size.medium }} 1200w"
|
||||
sizes="100vw"
|
||||
{{ end }} />
|
||||
<img
|
||||
{{ if $lazyLoad }}loading="lazy"{{ end }}
|
||||
src="{{ $size.large }}" alt="{{ $caption }}" />
|
||||
</picture>
|
||||
</a>
|
||||
{{ with $caption }}
|
||||
<figcaption>{{ . }}{{ with $source.Params.credits }} ({{ . | $.Page.RenderString }}){{ end }}</figcaption>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue