tutto il js taglist in un file apposito #327

Merged
paspo merged 1 commits from paspo/bglug.it:taglist-js into main 2024-10-30 22:04:57 +00:00
2 changed files with 14 additions and 14 deletions
Showing only changes of commit 54bae3545d - Show all commits

View File

@ -1,5 +1,6 @@
function show_all_tags(e) { var moretags = document.getElementById('more-tags');
moretags.addEventListener('click', function(e) {
$(".tags-sidebar li").removeClass("hidden"); $(".tags-sidebar li").removeClass("hidden");
$(e).addClass("hidden"); $(moretags).parent().addClass("hidden");
return false; e.stopPropagation();
} }, false);

View File

@ -1,13 +1,4 @@
<section> <section>
{{ $js := resources.Get "js/taglist.js" }}
{{ with $js | minify | fingerprint }}
<script
src="{{ .RelPermalink }}"
integrity="{{ .Data.Integrity }}"
crossorigin="anonymous"></script>
{{ end }}
<h3>Tags</h3> <h3>Tags</h3>
<ul class="tags-sidebar"> <ul class="tags-sidebar">
@ -58,6 +49,14 @@
<a style="font-size: {{ $font_size }}rem;" href="/{{ .Page.Lang }}{{ .Page.Path }}">{{ .Page.LinkTitle | safeHTML }} ({{ len .Pages }})</a></li> <a style="font-size: {{ $font_size }}rem;" href="/{{ .Page.Lang }}{{ .Page.Path }}">{{ .Page.LinkTitle | safeHTML }} ({{ len .Pages }})</a></li>
{{ end }} {{ end }}
{{ end }} {{ end }}
<li><a href="#" onclick="return show_all_tags(this)">{{ T "more_tags" }}</a></li> <li><a id="more-tags">{{ T "more_tags" }}</a></li>
</ul> </ul>
{{ $js := resources.Get "js/taglist.js" }}
{{ with $js | minify | fingerprint }}
<script
src="{{ .RelPermalink }}"
integrity="{{ .Data.Integrity }}"
crossorigin="anonymous"></script>
{{ end }}
</section> </section>