diff options
Diffstat (limited to 'tags.html')
-rw-r--r-- | tags.html | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/tags.html b/tags.html new file mode 100644 index 0000000..84a24b0 --- /dev/null +++ b/tags.html @@ -0,0 +1,41 @@ +--- +title: tags +layout: default +id: tags +toc: false +post: false +--- + +<div class="dispjs"> + <button onclick="toggle_open(this)" type="button">open all</button> +</div> +<script defer> + function toggle_open(btn) { + const open = btn.hasAttribute("open"); + btn[open ? "removeAttribute" : "setAttribute"]("open", ""); + for (let el of document.getElementsByTagName("details")) { + el[open ? "removeAttribute" : "setAttribute"]("open", ""); + } + btn.innerText = `${open ? "open" : "close"} all`; + } +</script> +<ul> + {% assign tags = site.data.tags %} + {% for tag in tags %} + <li class="stub"> + <details> + <summary> + {{ tag[0] }} ({{ tag[1] }}) + </summary> + <ul> + {% assign posts = site.items | where_exp: "post", "post.tags contains tag[0]" %} + {% for post in posts %} + <li><a href="{{ post.url }}">{{ post.title }}</a></li> + {% endfor %} + </ul> + </details> + </li> + {% endfor %} +</ul> + + |