fix: .File.Path warnings

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

View file

@ -21,8 +21,8 @@
</div> </div>
{{ with .File }} {{ with .File }}
<script> <script>
var oid = "views_{{ .Path }}" var oid = "views_{{ with .File }}{{ .Path }}{{ end }}"
var oid_likes = "likes_{{ .Path }}" var oid_likes = "likes_{{ with .File }}{{ .Path }}{{ end }}"
</script> </script>
{{ end }} {{ end }}
{{ $jsPage := resources.Get "js/page.js" }} {{ $jsPage := resources.Get "js/page.js" }}
@ -141,4 +141,4 @@
{{ partial "pagination.html" . }} {{ partial "pagination.html" . }}
{{ end }} {{ end }}

View file

@ -88,8 +88,8 @@
{{ with .File }} {{ with .File }}
<script> <script>
var oid = "views_{{ .Path }}" var oid = "views_{{ with .File }}{{ .Path }}{{ end }}"
var oid_likes = "likes_{{ .Path }}" var oid_likes = "likes_{{ with .File }}{{ .Path }}{{ end }}"
</script> </script>
{{ end }} {{ end }}
{{ $jsPage := resources.Get "js/page.js" }} {{ $jsPage := resources.Get "js/page.js" }}
@ -114,4 +114,4 @@
{{ end }} {{ end }}
</footer> </footer>
</article> </article>
{{ end }} {{ end }}

View file

@ -4,9 +4,9 @@
{{ else if eq .Kind "term"}} {{ else if eq .Kind "term"}}
<span id="likes_term_{{ .Page.Data.Term }}" <span id="likes_term_{{ .Page.Data.Term }}"
{{ else }} {{ else }}
<span id="likes_{{ .File.Path }}" <span id="likes_{{ with .File }}{{ .Path }}{{ end }}" title="likes">0</span>
{{ end }} {{ end }}
class="animate-pulse inline-block text-transparent max-h-3 rounded-full mt-[-2px] align-middle bg-neutral-300 dark:bg-neutral-400" title="likes">loading</span> class="animate-pulse inline-block text-transparent max-h-3 rounded-full mt-[-2px] align-middle bg-neutral-300 dark:bg-neutral-400" title="likes">loading</span>
<span class="inline-block align-text-bottom">{{ partial "icon.html" "heart" }}</span> <span class="inline-block align-text-bottom">{{ partial "icon.html" "heart" }}</span>
</span> </span>
{{- /* Trim EOF */ -}} {{- /* Trim EOF */ -}}

View file

@ -4,7 +4,7 @@
{{ else if eq .Kind "term"}} {{ else if eq .Kind "term"}}
<span id="views_term_{{ .Page.Data.Term }}" <span id="views_term_{{ .Page.Data.Term }}"
{{ else }} {{ else }}
<span id="views_{{ .File.Path }}" <span id="views_{{ with .File }}{{ .Path }}{{ end }}" title="views">0</span>
{{ end }} {{ end }}
class="animate-pulse inline-block text-transparent max-h-3 rounded-full mt-[-2px] align-middle bg-neutral-300 dark:bg-neutral-400" title="views">loading</span> class="animate-pulse inline-block text-transparent max-h-3 rounded-full mt-[-2px] align-middle bg-neutral-300 dark:bg-neutral-400" title="views">loading</span>
<span class="inline-block align-text-bottom">{{ partial "icon.html" "eye" }}</span> <span class="inline-block align-text-bottom">{{ partial "icon.html" "eye" }}</span>