fixed bug in list.html likes and views

This commit is contained in:
Nuno Coração 2023-05-08 21:35:02 +01:00
parent e75be1c390
commit cb77f886ea
2 changed files with 14 additions and 10 deletions

View file

@ -10,14 +10,6 @@
{{ end }} {{ end }}
{{- end -}} {{- end -}}
<script>
var oid = "views_{{ .File.Path }}"
var oid_likes = "likes_{{ .File.Path }}"
</script>
{{ $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>
{{ $toc := and (.Params.showTableOfContents | default (.Site.Params.list.showTableOfContents | default false)) (in {{ $toc := and (.Params.showTableOfContents | default (.Site.Params.list.showTableOfContents | default false)) (in
.TableOfContents "<ul") }} <header> .TableOfContents "<ul") }} <header>
{{ if .Params.showBreadcrumbs | default (.Site.Params.list.showBreadcrumbs | default false) }} {{ if .Params.showBreadcrumbs | default (.Site.Params.list.showBreadcrumbs | default false) }}
@ -27,6 +19,13 @@
<div class="mt-1 mb-2 text-base text-neutral-500 dark:text-neutral-400 print:hidden"> <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") }} {{ partial "article-meta/list.html" (dict "context" . "scope" "single") }}
</div> </div>
<script>
var oid = "views_{{ .File.Path }}"
var oid_likes = "likes_{{ .File.Path }}"
</script>
{{ $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>
</header> </header>
<section class="{{ if $toc -}} <section class="{{ if $toc -}}
mt-12 mt-12
@ -44,6 +43,9 @@
{{ .Content | emojify }} {{ .Content | emojify }}
</div> </div>
</section> </section>
{{ if gt .Pages 0 }} {{ if gt .Pages 0 }}

View file

@ -42,14 +42,16 @@
</br></br> </br></br>
{{ partial "series-closed.html" . }} {{ partial "series-closed.html" . }}
</div> </div>
<script>
<script>
var oid = "views_{{ .File.Path }}" var oid = "views_{{ .File.Path }}"
var oid_likes = "likes_{{ .File.Path }}" var oid_likes = "likes_{{ .File.Path }}"
</script> </script>
{{ $jsPage := resources.Get "js/page.js" }} {{ $jsPage := resources.Get "js/page.js" }}
{{ $jsPage = $jsPage | resources.Minify | resources.Fingerprint "sha512" }} {{ $jsPage = $jsPage | resources.Minify | resources.Fingerprint "sha512" }}
<script type="text/javascript" src="{{ $jsPage.RelPermalink }}" integrity="{{ $jsPage.Data.Integrity }}"></script> <script type="text/javascript" src="{{ $jsPage.RelPermalink }}" integrity="{{ $jsPage.Data.Integrity }}"></script>
</section>
</section>
<footer class="pt-8 max-w-prose print:hidden"> <footer class="pt-8 max-w-prose print:hidden">
{{ partial "author.html" . }} {{ partial "author.html" . }}