From b943b22f0b80840ffb91472cb1330be2a3d5824f Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Tue, 21 Apr 2026 23:29:43 +0200 Subject: docs: add tag cloud spiral implementation plan --- .../plans/2026-04-21-tag-cloud-spiral.md | 336 +++++++++++++++++++++ 1 file changed, 336 insertions(+) create mode 100644 docs/superpowers/plans/2026-04-21-tag-cloud-spiral.md (limited to 'docs/superpowers/plans/2026-04-21-tag-cloud-spiral.md') diff --git a/docs/superpowers/plans/2026-04-21-tag-cloud-spiral.md b/docs/superpowers/plans/2026-04-21-tag-cloud-spiral.md new file mode 100644 index 0000000..808b2cb --- /dev/null +++ b/docs/superpowers/plans/2026-04-21-tag-cloud-spiral.md @@ -0,0 +1,336 @@ +# Tag Cloud Spiral Layout Implementation Plan + +> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. + +**Goal:** Replace the flat flex-wrap tag cloud with an Archimedean spiral layout where big tags cluster at center and smaller tags scatter outward, deterministically per tag text. + +**Architecture:** Vanilla JS module reads `data-weight` attributes rendered by the Hugo partial, sorts tags by weight, places them along an outward Archimedean spiral with AABB collision detection, then sets absolute positions. Falls back to existing centered flex layout when JS is disabled or container is < 400px wide. + +**Tech Stack:** Hugo (partial modification), Vanilla JS (ES5-compatible, no build step), Hugo Pipes (minify), existing CSS variables for theming. + +--- + +## File Map + +| Action | Path | Responsibility | +|--------|------|----------------| +| Modify | `themes/danix-xyz-hacker/layouts/partials/tag-cloud.html` | Add `data-weight` attr to links, `data-tag-cloud` to container | +| Modify | `themes/danix-xyz-hacker/assets/css/main.css` | Add `overflow: visible` to `.tag-cloud` | +| Create | `themes/danix-xyz-hacker/assets/js/tag-cloud-spiral.js` | Spiral placement algorithm | +| Modify | `themes/danix-xyz-hacker/layouts/_default/baseof.html` | Load spiral script via Hugo Pipes | + +--- + +### Task 1: Add data attributes to tag-cloud partial + +**Files:** +- Modify: `themes/danix-xyz-hacker/layouts/partials/tag-cloud.html:42,49,57` + +- [ ] **Step 1: Add `data-tag-cloud` to both container divs** + +In `tag-cloud.html`, both render paths have `
`. Add `data-tag-cloud` attribute to each: + +```html +{{- if $wrapInWidget -}} +