mirror of
https://github.com/CaiJimmy/hugo-theme-stack.git
synced 2024-11-23 18:31:45 +01:00
style(helper/image): code formatting
This commit is contained in:
parent
a2732a312a
commit
2079174aa9
1 changed files with 5 additions and 4 deletions
|
@ -5,8 +5,8 @@
|
|||
{{ if $imageValue }}
|
||||
<!-- If page has `image` field set -->
|
||||
{{ $result = merge $result (dict "exists" true) }}
|
||||
|
||||
{{ $url := urls.Parse $imageValue }}
|
||||
|
||||
{{ if or (eq $url.Scheme "http") (eq $url.Scheme "https") }}
|
||||
<!-- Is a external image -->
|
||||
{{ $result = merge $result (dict "permalink" $imageValue) }}
|
||||
|
@ -27,11 +27,11 @@
|
|||
{{ errorf "Failed loading image: %q" $imageValue }}
|
||||
{{ $result = merge $result (dict "exists" false) }}
|
||||
{{ end }}
|
||||
|
||||
{{ end }}
|
||||
|
||||
{{ else if and (ne .Type nil) (index .Context.Site.Params.defaultImage .Type) }}
|
||||
<!-- Type arg is set, check for defaultImage setting -->
|
||||
|
||||
{{ $defaultImageSetting := index .Context.Site.Params.defaultImage .Type }}
|
||||
|
||||
{{ if $defaultImageSetting.enabled }}
|
||||
|
@ -52,11 +52,12 @@
|
|||
{{ end }}
|
||||
|
||||
{{ else }}
|
||||
|
||||
<!-- External image -->
|
||||
{{ $result = merge $result (dict "permalink" $defaultImageSetting.src) }}
|
||||
|
||||
{{ end }}
|
||||
|
||||
{{ end }}
|
||||
|
||||
{{ end }}
|
||||
|
||||
{{ return $result }}
|
Loading…
Reference in a new issue