🎨 Implement loaders for fetched information (views and likes)

This commit is contained in:
Nuno Coração
2023-12-06 21:40:38 +00:00
parent 4bc1ed0a86
commit 065bf2b060
5 changed files with 51 additions and 7 deletions

View File

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

View File

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