mirror of
https://github.com/nunocoracao/blowfish.git
synced 2025-01-22 14:35:43 -06:00
feat: add nozoom attribute to figure
This commit is contained in:
parent
6e0164d0e4
commit
ea2f848064
1 changed files with 4 additions and 3 deletions
|
@ -7,6 +7,7 @@
|
|||
{{ $caption := .Get "caption" }}
|
||||
{{ $href := .Get "href" }}
|
||||
{{ $class := .Get "class" }}
|
||||
{{ $nozoom := .Get "nozoom" | default false }}
|
||||
{{ if findRE "^https?" $url.Scheme }}
|
||||
<figure>
|
||||
<img class="my-0 rounded-md" src="{{ $url.String }}" alt="{{ $altText }}" />
|
||||
|
@ -24,13 +25,13 @@
|
|||
{{ with $href }}<a href="{{ . }}">{{ end }}
|
||||
{{ if $disableImageOptimization }}
|
||||
<img
|
||||
class="my-0 rounded-md"
|
||||
class="my-0 rounded-md{{ if $nozoom }} nozoom{{ end }}"
|
||||
src="{{ .RelPermalink }}"
|
||||
alt="{{ $altText }}"
|
||||
/>
|
||||
{{ else }}
|
||||
<img
|
||||
class="my-0 rounded-md"
|
||||
class="my-0 rounded-md{{ if $nozoom }} nozoom{{ end }}"
|
||||
srcset="
|
||||
{{ (.Resize "330x").RelPermalink }} 330w,
|
||||
{{ (.Resize "660x").RelPermalink }} 660w,
|
||||
|
@ -45,7 +46,7 @@
|
|||
</figure>
|
||||
{{ else }}
|
||||
<figure>
|
||||
<img class="my-0 rounded-md" src="{{ $url.String }}" alt="{{ $altText }}" />
|
||||
<img class="my-0 rounded-md{{ if $nozoom }} nozoom{{ end }}" src="{{ $url.String }}" alt="{{ $altText }}" />
|
||||
{{ with $caption }}<figcaption>{{ . | markdownify }}</figcaption>{{ end }}
|
||||
</figure>
|
||||
{{ end }}
|
||||
|
|
Loading…
Reference in a new issue