fix: theme color and og images
All checks were successful
Deploy workflow / deploy (push) Successful in 13s
All checks were successful
Deploy workflow / deploy (push) Successful in 13s
This commit is contained in:
parent
8253e02383
commit
730dd5e109
2 changed files with 6 additions and 12 deletions
|
@ -24,9 +24,9 @@
|
||||||
<link rel="apple-touch-icon" sizes="192x192" href="{{ $faviconSm.RelPermalink }}">
|
<link rel="apple-touch-icon" sizes="192x192" href="{{ $faviconSm.RelPermalink }}">
|
||||||
<link rel="icon" type="image/png" sizes="192x192" href="{{ $faviconSm.RelPermalink }}">
|
<link rel="icon" type="image/png" sizes="192x192" href="{{ $faviconSm.RelPermalink }}">
|
||||||
<link rel="manifest" href="/manifest.json">
|
<link rel="manifest" href="/manifest.json">
|
||||||
<meta name="msapplication-TileColor" content="#025E73">
|
<meta name="msapplication-TileColor" content="#009124">
|
||||||
<meta name="msapplication-TileImage" content="{{ $faviconSm.RelPermalink }}">
|
<meta name="msapplication-TileImage" content="{{ $faviconSm.RelPermalink }}">
|
||||||
<meta name="theme-color" content="#025E73">
|
<meta name="theme-color" content="#009124">
|
||||||
|
|
||||||
<!-- Note: j'ai galérer à rajouter du scss car en fait y'avait déja une variable $style de définit plus haut... -->
|
<!-- Note: j'ai galérer à rajouter du scss car en fait y'avait déja une variable $style de définit plus haut... -->
|
||||||
{{ $style := resources.Get "sass/main.scss" | resources.ToCSS | resources.Fingerprint }}
|
{{ $style := resources.Get "sass/main.scss" | resources.ToCSS | resources.Fingerprint }}
|
||||||
|
|
|
@ -13,26 +13,21 @@
|
||||||
<!-- Is an external image -->
|
<!-- Is an external image -->
|
||||||
{{ $result = merge $result (dict "permalink" $imageValue) }}
|
{{ $result = merge $result (dict "permalink" $imageValue) }}
|
||||||
{{ else }}
|
{{ else }}
|
||||||
{{ $pageResourceImage := resources.GetMatch (printf "%s" ($imageValue | safeURL)) }}
|
{{ $pageResourceImage := (.Context.Resources.GetMatch ($imageValue | safeURL)).Fill "300x300 center" }}
|
||||||
|
|
||||||
{{ if $pageResourceImage }}
|
{{ if $pageResourceImage }}
|
||||||
<!-- If image is found under page bundle -->
|
<!-- If image is found under page bundle -->
|
||||||
{{ $result = merge $result (dict "permalink" $pageResourceImage.RelPermalink) }}
|
{{ $result = merge $result (dict "permalink" $pageResourceImage.RelPermalink) }}
|
||||||
|
|
||||||
<!-- Disable SVG image processing, not supported by Hugo -->
|
|
||||||
{{ if ne (path.Ext $imageValue) ".svg" }}
|
|
||||||
{{ $result = merge $result (dict "resource" $pageResourceImage) }}
|
|
||||||
{{ end }}
|
|
||||||
{{ else }}
|
{{ else }}
|
||||||
<!-- Can not find the image under page bundle. Could be a relative linked image -->
|
<!-- Can not find the image under page bundle. Could be a relative linked image -->
|
||||||
{{ $result = merge $result (dict "permalink" (relURL $imageValue)) }}
|
{{ $result = merge $result (dict "permalink" (printf "%s" (relURL $imageValue))) }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ else }}
|
{{ else }}
|
||||||
<!-- Type arg is set, check for defaultImage setting -->
|
<!-- Type arg is set, check for defaultImage setting -->
|
||||||
{{ $defaultImageSetting := .Context.Site.Params.defaultCoverImage }}
|
{{ $defaultImageSetting := .Context.Site.Params.defaultImage }}
|
||||||
|
|
||||||
{{ $result = merge $result (dict "isDefault" true) }}
|
{{ $result = merge $result (dict "isDefault" true) }}
|
||||||
{{ $result = merge $result (dict "exists" true) }}
|
{{ $result = merge $result (dict "exists" true) }}
|
||||||
|
@ -42,8 +37,7 @@
|
||||||
|
|
||||||
{{ if $siteResourceImage }}
|
{{ if $siteResourceImage }}
|
||||||
<!-- Try search image under site's assets folder -->
|
<!-- Try search image under site's assets folder -->
|
||||||
{{ $result = merge $result (dict "permalink" $siteResourceImage.RelPermalink) }}
|
{{ $result = merge $result (dict "permalink" ($siteResourceImage.Fill "300x300 center").RelPermalink) }}
|
||||||
{{ $result = merge $result (dict "resource" $siteResourceImage) }}
|
|
||||||
{{ else }}
|
{{ else }}
|
||||||
<!-- Can not find the image -->
|
<!-- Can not find the image -->
|
||||||
{{ errorf "Failed loading image: %q" $defaultImageSetting.src }}
|
{{ errorf "Failed loading image: %q" $defaultImageSetting.src }}
|
||||||
|
|
Loading…
Reference in a new issue