fix: .File.Path warnings

This commit is contained in:
Edoardo Rosa 2023-11-25 16:03:50 +01:00
parent f037cb2f69
commit 5c19c71e99
No known key found for this signature in database
GPG key ID: 2AF1937D15CB28F6
4 changed files with 9 additions and 9 deletions

View file

@ -20,8 +20,8 @@
{{ partial "article-meta/list.html" (dict "context" . "scope" "single") }}
</div>
<script>
var oid = "views_{{ .File.Path }}"
var oid_likes = "likes_{{ .File.Path }}"
var oid = "views_{{ with .File }}{{ .Path }}{{ end }}"
var oid_likes = "likes_{{ with .File }}{{ .Path }}{{ end }}"
</script>
{{ $jsPage := resources.Get "js/page.js" }}
{{ $jsPage = $jsPage | resources.Minify | resources.Fingerprint "sha512" }}
@ -139,4 +139,4 @@
{{ partial "pagination.html" . }}
{{ end }}
{{ end }}

View file

@ -87,8 +87,8 @@
</div>
<script>
var oid = "views_{{ .File.Path }}"
var oid_likes = "likes_{{ .File.Path }}"
var oid = "views_{{ with .File }}{{ .Path }}{{ end }}"
var oid_likes = "likes_{{ with .File }}{{ .Path }}{{ end }}"
</script>
{{ $jsPage := resources.Get "js/page.js" }}
{{ $jsPage = $jsPage | resources.Minify | resources.Fingerprint "sha512" }}
@ -112,4 +112,4 @@
{{ end }}
</footer>
</article>
{{ end }}
{{ end }}

View file

@ -4,8 +4,8 @@
{{ else if eq .Kind "term"}}
<span id="likes_term_{{ .Page.Data.Term }}" title="likes">0</span>
{{ else }}
<span id="likes_{{ .File.Path }}" title="likes">0</span>
<span id="likes_{{ with .File }}{{ .Path }}{{ end }}" title="likes">0</span>
{{ end }}
<span class="inline-block align-text-bottom">{{ partial "icon.html" "heart" }}</span>
</span>
{{- /* Trim EOF */ -}}
{{- /* Trim EOF */ -}}

View file

@ -4,7 +4,7 @@
{{ else if eq .Kind "term"}}
<span id="views_term_{{ .Page.Data.Term }}" title="views">0</span>
{{ else }}
<span id="views_{{ .File.Path }}" title="views">0</span>
<span id="views_{{ with .File }}{{ .Path }}{{ end }}" title="views">0</span>
{{ end }}
<span class="inline-block align-text-bottom">{{ partial "icon.html" "eye" }}</span>
</span>