Fix list.html render issue

FIXED: execute of template failed: template: _default/list.html:23:19: executing "main" at <.File.Path>: error calling Path: runtime error: invalid memory address or nil pointer dereference
This commit is contained in:
Aphcity 2024-03-21 10:17:55 +08:00 committed by GitHub
parent fd1dd03358
commit 5edba5cf2e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -19,7 +19,7 @@
<div class="mt-1 mb-2 text-base text-neutral-500 dark:text-neutral-400 print:hidden">
{{ partial "article-meta/list.html" (dict "context" . "scope" "single") }}
</div>
{{ with .File }}
{{ $path := .File.Path }}
{{range .AllTranslations}}
{{ $lang := print "." .Lang ".md" }}
@ -29,6 +29,7 @@
var oid = "views_{{ $path }}"
var oid_likes = "likes_{{ $path }}"
</script>
{{ end }}
{{ $jsPage := resources.Get "js/page.js" }}
{{ $jsPage = $jsPage | resources.Minify | resources.Fingerprint "sha512" }}
<script type="text/javascript" src="{{ $jsPage.RelPermalink }}" integrity="{{ $jsPage.Data.Integrity }}"></script>