feat: Suppression des warning Hugo

This commit is contained in:
Simon 2021-05-03 16:32:23 +02:00
parent 17a13a4430
commit c0cf2e73be
3 changed files with 3 additions and 3 deletions

View File

@ -1,5 +1,5 @@
{{/*
S'il n'y a pas de / dans l'url d'une image alors on ajoute le path de l'article
*/}}
{{ $path := cond (in .Destination "/") .Destination (path.Join "/" .Page.Dir .Destination) }}
{{ $path := cond (in .Destination "/") .Destination (path.Join "/" .Page.File.Dir .Destination) }}
<img src="{{ $path | safeURL }}" alt="{{ .Text }}" {{ with .Title}} title="{{ . }}"{{ end }} />

View File

@ -7,7 +7,7 @@
{{ $isMailtoLink := strings.HasPrefix .Destination "mailto:" }}
{{ $hasSlash := in .Destination "/" }}
{{- if $isWebLink -}}
{{ $link := cond (and $isWebLink (and (not $hasSlash) (not $isExternalLink))) (path.Join "/" .Page.Dir .Destination) .Destination }}
{{ $link := cond (and $isWebLink (and (not $hasSlash) (not $isExternalLink))) (path.Join "/" .Page.File.Dir .Destination) .Destination }}
<a href="{{ $link | safeURL }}"{{ with .Title}} title="{{ . }}"{{ end }}{{ if $isExternalLink }} target="_blank" rel="noopener"{{ end }}>{{ .Text | safeHTML }}</a>
{{- else -}}
{{- $separators := cond $isMailtoLink ":@." ":" -}}

View File

@ -6,7 +6,7 @@
<ul>
{{ block "list" . }}
{{ range .Pages }}
<li><a href="{{ .URL }}">{{ .RenderString .Title }}</a></li>
<li><a href="{{ .Permalink }}">{{ .RenderString .Title }}</a></li>
{{ end }}
{{ end }}
</ul>