Compare commits

...

2 Commits

Author SHA1 Message Date
Nuno Coração
8da083ad24 Merge pull request #369 from nunocoracao/368-bug-likes-in-taxonomies-and-terms-is-shared-globally
🐛 fixed likes and view counters for taxonomies and terms
2023-01-01 22:24:35 +00:00
Nuno Coração
7049775470 🐛 fixed likes and view counters for taxonomies and terms 2023-01-01 22:23:42 +00:00
5 changed files with 17 additions and 5 deletions

View File

@@ -30,8 +30,8 @@
</section> </section>
{{ end }} {{ end }}
<script> <script>
var oid = "views_{{ .File.Path }}" var oid = "views_taxonomy_{{ .Data.Plural }}"
var oid_likes = "likes_{{ .File.Path }}" var oid_likes = "likes_taxonomy_{{ .Data.Plural }}"
</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" }}

View File

@@ -28,8 +28,8 @@
</div> </div>
{{ end }} {{ end }}
<script> <script>
var oid = "views_{{ .File.Path }}" var oid = "views_term_{{ .Data.Term }}"
var oid_likes = "likes_{{ .File.Path }}" var oid_likes = "likes_term_{{ .Data.Term }}"
</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" }}

View File

@@ -1,5 +1,11 @@
<span> <span>
{{ if eq .Kind "taxonomy"}}
<span id="likes_taxonomy_{{ .Page.Data.Plural }}" title="likes">0</span>
{{ else if eq .Kind "term"}}
<span id="likes_term_{{ .Page.Data.Term }}" title="likes">0</span>
{{ else }}
<span id="likes_{{ .File.Path }}" title="likes">0</span> <span id="likes_{{ .File.Path }}" title="likes">0</span>
{{ end }}
<span class="inline-block align-text-bottom">{{ partial "icon.html" "heart" }}</span> <span class="inline-block align-text-bottom">{{ partial "icon.html" "heart" }}</span>
</span> </span>
{{- /* Trim EOF */ -}} {{- /* Trim EOF */ -}}

View File

@@ -1,5 +1,11 @@
<span> <span>
{{ if eq .Kind "taxonomy"}}
<span id="views_taxonomy_{{ .Page.Data.Plural }}" title="views">0</span>
{{ else if eq .Kind "term"}}
<span id="views_term_{{ .Page.Data.Term }}" title="views">0</span>
{{ else }}
<span id="views_{{ .File.Path }}" title="views">0</span> <span id="views_{{ .File.Path }}" title="views">0</span>
{{ end }}
<span class="inline-block align-text-bottom">{{ partial "icon.html" "eye" }}</span> <span class="inline-block align-text-bottom">{{ partial "icon.html" "eye" }}</span>
</span> </span>
{{- /* Trim EOF */ -}} {{- /* Trim EOF */ -}}

View File

@@ -1,6 +1,6 @@
{ {
"name": "hugo-blowfish-theme", "name": "hugo-blowfish-theme",
"version": "2.22.1", "version": "2.22.2",
"description": "Blowfish theme for Hugo", "description": "Blowfish theme for Hugo",
"scripts": { "scripts": {
"fullinstall": "npm run preinstall && npm install && npm run postinstall", "fullinstall": "npm run preinstall && npm install && npm run postinstall",