Skip to content

Commit

Permalink
fixed problem with likes/views rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
nunocoracao committed Apr 7, 2024
1 parent 756d07a commit 6daf41e
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 28 deletions.
27 changes: 15 additions & 12 deletions layouts/partials/meta/likes.html
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
<span>
{{ $id := "null" }}
{{ if eq .Kind "taxonomy" }}
<span id="likes_taxonomy_{{ .Page.Data.Plural }}">
{{ $id = delimit (slice "likes_taxonomy_" .Page.Data.Plural) "" }}
{{ else if eq .Kind "term" }}
<span id="likes_term_{{ .Page.Data.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}}
<span id="likes_{{ $path }}">
{{ 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</span>
<span id="{{ $id }}"
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>
33 changes: 17 additions & 16 deletions layouts/partials/meta/views.html
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
<span>
{{ if eq .Kind "taxonomy" }}
<span id="views_taxonomy_{{ .Page.Data.Plural }}">
{{ else if eq .Kind "term" }}
<span id="views_term_{{ .Page.Data.Term }}">
{{ else }}
{{ $translations := .AllTranslations }}
{{ with .File }}
{{ $path := .Path }}
{{range $translations}}
{{ $lang := print "." .Lang ".md" }}
{{ $path = replace $path $lang ".md" }}
{{end}}
<span id="views_{{ $path }}">
{{ 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</span>
<span class="inline-block align-text-bottom">{{ partial "icon.html" "eye" }}</span>
{{ end }}
<span id="{{ $id }}" 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>

0 comments on commit 6daf41e

Please sign in to comment.