Clean up the taxonomy list

Make the name of the taxonomy copyable by putting it in the dom, rather than in
the CSS content:.
This commit is contained in:
Eryn Wells 2024-10-08 21:58:57 -07:00
parent cd503b1275
commit f7928c2190
2 changed files with 32 additions and 23 deletions

View file

@ -8,28 +8,36 @@
***************************/ ***************************/
.taxonomy-list { .taxonomy-list {
--spacing: 1ch; display: flex;
gap: 1ch;
font-family: var(--font-family-monospace);
display: flex; .taxonomy-list__name {
font-family: var(--font-family-monospace); color: var(--text-color-secondary);
gap: var(--spacing); text-transform: uppercase;
list-style-type: none;
margin-block: 0;
padding-inline-start: 0;
&::before { &::after {
color: var(--text-color-secondary); content: " =";
content: attr(data-name) " =";
text-transform: uppercase;
} }
}
li { .taxonomy-list__terms {
--spacing: 1ch;
display: flex;
gap: var(--spacing);
list-style-type: none;
margin-block: 0;
padding-inline-start: 0; padding-inline-start: 0;
}
li:not(:last-child)::after { li {
color: var(--text-color-secondary); padding-inline-start: 0;
content: ":"; }
margin-inline-start: var(--spacing);
} li:not(:last-child)::after {
color: var(--text-color-secondary);
content: ":";
margin-inline-start: var(--spacing);
}
}
} }

View file

@ -13,9 +13,10 @@
{{- with T $taxonomy (len .) }} {{- with T $taxonomy (len .) }}
{{ $name = . }} {{ $name = . }}
{{ end -}} {{ end -}}
<ul class="taxonomy-list" data-name="{{ $name }}"> <div class="taxonomy-list">
{{ range . }} <span class="taxonomy-list__name">{{ $name }}</span>
<li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li> <ul class="taxonomy-list__terms" data-name="{{ $name }}">
{{ end }} {{ range . }}<li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>{{ end }}
</ul> </ul>
</div>
{{ end }} {{ end }}