mirror of
https://github.com/nunocoracao/blowfish.git
synced 2025-02-02 03:22:33 -06:00
Merge pull request #1492 from nunocoracao/1112-some-figure-shortcode-attributes-have-no-effect
fixed https://github.com/nunocoracao/blowfish/issues/1112
This commit is contained in:
commit
a0dd73975c
1 changed files with 11 additions and 16 deletions
|
@ -7,13 +7,13 @@
|
|||
{{ $caption := .Get "caption" }}
|
||||
{{ $href := .Get "href" }}
|
||||
{{ $class := .Get "class" }}
|
||||
{{ $target := .Get "target" }}
|
||||
{{ $target := .Get "target" | default "_blank" }}
|
||||
{{ $nozoom := .Get "nozoom" | default false }}
|
||||
|
||||
<figure>
|
||||
{{ with $href }}<a href="{{ . }}" {{ with $target }}target="{{ . }}"{{ end }}>{{ end }}
|
||||
{{ if findRE "^https?" $url.Scheme }}
|
||||
<figure>
|
||||
<img class="my-0 rounded-md" src="{{ $url.String }}" alt="{{ $altText }}" />
|
||||
{{ with $caption }}<figcaption>{{ . | markdownify }}</figcaption>{{ end }}
|
||||
</figure>
|
||||
<img class="my-0 rounded-md {{ with $nozoom }} nozoom {{ end }}{{ with $class }} {{ . }} {{ end }}" src="{{ $url.String }}" alt="{{ $altText }}" />
|
||||
{{ else }}
|
||||
{{ $resource := "" }}
|
||||
{{ if $.Page.Resources.GetMatch ($url.String) }}
|
||||
|
@ -22,17 +22,15 @@
|
|||
{{ $resource = resources.Get ($url.String) }}
|
||||
{{ end }}
|
||||
{{ with $resource }}
|
||||
<figure {{ with $class }}class="{{ . }}"{{ end }}>
|
||||
{{ with $href }}<a href="{{ . }}" {{ with $target }}target="{{ . }}"{{ end }}>{{ end }}
|
||||
{{ if $disableImageOptimization }}
|
||||
<img
|
||||
class="my-0 rounded-md{{ if $nozoom }} nozoom{{ end }}"
|
||||
class="my-0 rounded-md {{ with $nozoom }} nozoom {{ end }}{{ with $class }} {{ . }} {{ end }}"
|
||||
src="{{ .RelPermalink }}"
|
||||
alt="{{ $altText }}"
|
||||
/>
|
||||
{{ else }}
|
||||
<img
|
||||
class="my-0 rounded-md{{ if $nozoom }} nozoom{{ end }}"
|
||||
class="my-0 rounded-md {{ with $nozoom }} nozoom {{ end }}{{ with $class }} {{ . }} {{ end }}"
|
||||
srcset="
|
||||
{{ (.Resize "330x").RelPermalink }} 330w,
|
||||
{{ (.Resize "660x").RelPermalink }} 660w,
|
||||
|
@ -42,14 +40,11 @@
|
|||
alt="{{ $altText }}"
|
||||
/>
|
||||
{{ end }}
|
||||
{{ if $href }}</a>{{ end }}
|
||||
{{ with $caption }}<figcaption>{{ . | markdownify }}</figcaption>{{ end }}
|
||||
</figure>
|
||||
{{ else }}
|
||||
<figure>
|
||||
<img class="my-0 rounded-md{{ if $nozoom }} nozoom{{ end }}" src="{{ $url.String }}" alt="{{ $altText }}" />
|
||||
{{ with $caption }}<figcaption>{{ . | markdownify }}</figcaption>{{ end }}
|
||||
</figure>
|
||||
<img class="my-0 rounded-md {{ with $nozoom }} nozoom {{ end }}{{ with $class }} {{ . }} {{ end }}" src="{{ $url.String }}" alt="{{ $altText }}" />
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ with $caption }}<figcaption>{{ . | markdownify }}</figcaption>{{ end }}
|
||||
{{ if $href }}</a>{{ end }}
|
||||
</figure>
|
||||
{{ end }}
|
||||
|
|
Loading…
Reference in a new issue