fix(images): use the right resource loader function and others things

This commit is contained in:
Matthieu Bessat 2023-07-10 17:44:29 +02:00
parent 303b5f04ab
commit 741ba5c10e
3 changed files with 19 additions and 17 deletions

View file

@ -7,21 +7,23 @@
<!-- src="{{ $image.RelPermalink }}" /> --> <!-- src="{{ $image.RelPermalink }}" /> -->
</a> </a>
<nav class="site-header__nav desktop-nav"> <nav class="site-header__nav desktop-nav">
{{ if eq .File.Dir "/" }} {{ with .File }}
<ul class="inline-menu-list"> {{ if eq .Dir "/" }}
<li><a href="#section-history">Histoire</a></li> <ul class="inline-menu-list">
<li><a href="#section-organization">L'association</a></li> <li><a href="#section-history">Histoire</a></li>
<li><a href="#section-news">Actualités</a></li> <li><a href="#section-organization">L'association</a></li>
<li><a href="/images">Galerie</a></li> <li><a href="#section-news">Actualités</a></li>
</ul> <li><a href="/images">Galerie</a></li>
{{ end }} </ul>
{{ if not (eq .File.Dir "/") }} {{ end }}
<ul class="inline-menu-list"> {{ if not (eq .Dir "/") }}
<li><a href="/actualites">Actualités</a></li> <ul class="inline-menu-list">
<li><a href="/association">L'association</a></li> <li><a href="/actualites">Actualités</a></li>
<li><a href="/histoires">Histoire</a></li> <li><a href="/association">L'association</a></li>
<li><a href="/images">Galerie</a></li> <li><a href="/histoires">Histoire</a></li>
</ul> <li><a href="/images">Galerie</a></li>
</ul>
{{ end }}
{{ end }} {{ end }}
</nav> </nav>
<div class="burger-menu"> <div class="burger-menu">

View file

@ -13,7 +13,7 @@
<!-- Is an external image --> <!-- Is an external image -->
{{ $result = merge $result (dict "permalink" $imageValue) }} {{ $result = merge $result (dict "permalink" $imageValue) }}
{{ else }} {{ else }}
{{ $pageResourceImage := .Context.Resources.GetMatch (printf "%s" ($imageValue | safeURL)) }} {{ $pageResourceImage := resources.GetMatch (printf "%s" ($imageValue | safeURL)) }}
{{ if $pageResourceImage }} {{ if $pageResourceImage }}
<!-- If image is found under page bundle --> <!-- If image is found under page bundle -->

View file

@ -37,7 +37,7 @@
{{- end -}} {{- end -}}
{{- end -}} {{- end -}}
{{ $image := partialCached "helpers/image" (dict "Context" . "Type" "opengraph") .RelPermalink "opengraph" }} {{ $image := partial "helpers/image" (dict "Context" . "Type" "opengraph") .RelPermalink "opengraph" }}
{{ if $image.exists }} {{ if $image.exists }}
<meta property="og:image" content="{{ absURL $image.permalink }}" /> <meta property="og:image" content="{{ absURL $image.permalink }}" />
{{- end -}} {{- end -}}