blob: 84a24b04c46326662ff9ff91573fc3fa13603ada (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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>
|