Weighted tag cloud: size reflects piece count (garden#9)
Custom taxonomy template: tags sorted by count, font-size scaled 80-200% based on weight. Heavy tags (essay: 29) are large and violet. Light tags are small and faint. Mono font, flex-wrapped, breathable spacing. Replaces the flat card grid on /tags/. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
a3a04a0343
commit
b610f20797
4 changed files with 534 additions and 449 deletions
27
layouts/taxonomy/tag.terms.html
Normal file
27
layouts/taxonomy/tag.terms.html
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
{{ define "main" }}
|
||||
<section>
|
||||
<header>
|
||||
<h1>Themes</h1>
|
||||
<p data-text="dim">{{ len .Data.Terms }} threads running through the garden</p>
|
||||
</header>
|
||||
|
||||
<div class="tag-cloud">
|
||||
{{- $max := 0 -}}
|
||||
{{- range .Data.Terms.Alphabetical -}}
|
||||
{{- if gt .Count $max }}{{ $max = .Count }}{{ end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- range .Data.Terms.ByCount -}}
|
||||
{{- $weight := div (mul .Count 100) $max -}}
|
||||
{{- $size := add 80 (div (mul $weight 120) 100) -}}
|
||||
<a href="{{ .Page.RelPermalink }}"
|
||||
class="tag-weight"
|
||||
style="font-size: {{ $size }}%{{ if ge $weight 60 }}; color: var(--garden-dialogue){{ else if ge $weight 30 }}; color: var(--garden-text-dim){{ else }}; color: var(--garden-text-faint){{ end }}"
|
||||
title="{{ .Count }} {{ if eq .Count 1 }}piece{{ else }}pieces{{ end }}">
|
||||
{{ .Page.Title }}
|
||||
<small>{{ .Count }}</small>
|
||||
</a>
|
||||
{{- end }}
|
||||
</div>
|
||||
</section>
|
||||
{{ end }}
|
||||
Loading…
Add table
Add a link
Reference in a new issue