From 6daf41ed2b3616ec85beab890fafd20a138c3b5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nuno=20Cora=C3=A7=C3=A3o?= Date: Sun, 7 Apr 2024 19:25:42 +0100 Subject: [PATCH] fixed problem with likes/views rendering --- layouts/partials/meta/likes.html | 27 ++++++++++++++------------ layouts/partials/meta/views.html | 33 ++++++++++++++++---------------- 2 files changed, 32 insertions(+), 28 deletions(-) diff --git a/layouts/partials/meta/likes.html b/layouts/partials/meta/likes.html index efe98437..9cb5ff6d 100644 --- a/layouts/partials/meta/likes.html +++ b/layouts/partials/meta/likes.html @@ -1,19 +1,22 @@ + {{ $id := "null" }} {{ if eq .Kind "taxonomy" }} - + {{ $id = delimit (slice "likes_taxonomy_" .Page.Data.Plural) "" }} {{ else if eq .Kind "term" }} - + {{ $id = delimit (slice "likes_term_" .Page.Data.Term) "" }} {{ else }} - {{ $translations := .AllTranslations }} - {{ with .File }} - {{ $path := .Path }} - {{range $translations}} - {{ $lang := print "." .Lang ".md" }} - {{ $path = replace $path $lang ".md" }} - {{end}} - - {{ end }} + {{ $translations := .AllTranslations }} + {{ with .File }} + {{ $path := .Path }} + {{range $translations}} + {{ $lang := print "." .Lang ".md" }} + {{ $path = replace $path $lang ".md" }} + {{end}} + {{ $id = delimit (slice "likes_" $path) "" }} + {{ 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 + loading {{ partial "icon.html" "heart" }} \ No newline at end of file diff --git a/layouts/partials/meta/views.html b/layouts/partials/meta/views.html index 4c831f9a..fc4a3868 100644 --- a/layouts/partials/meta/views.html +++ b/layouts/partials/meta/views.html @@ -1,19 +1,20 @@ - {{ if eq .Kind "taxonomy" }} - - {{ else if eq .Kind "term" }} - - {{ else }} - {{ $translations := .AllTranslations }} - {{ with .File }} - {{ $path := .Path }} - {{range $translations}} - {{ $lang := print "." .Lang ".md" }} - {{ $path = replace $path $lang ".md" }} - {{end}} - - {{ end }} + {{ $id := "null" }} + {{ if eq .Kind "taxonomy" }} + {{ $id = delimit (slice "views_taxonomy_" .Page.Data.Plural) "" }} + {{ else if eq .Kind "term" }} + {{ $id = delimit (slice "views_term_" .Page.Data.Term) "" }} + {{ else }} + {{ $translations := .AllTranslations }} + {{ with .File }} + {{ $path := .Path }} + {{range $translations}} + {{ $lang := print "." .Lang ".md" }} + {{ $path = replace $path $lang ".md" }} + {{end}} + {{ $id = delimit (slice "views_" $path) "" }} {{ 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 - {{ partial "icon.html" "eye" }} + {{ end }} + loading + {{ partial "icon.html" "eye" }} \ No newline at end of file