$slugs) { $tagCounts[$slug] = count($slugs); } } // Collect original display names from posts (slugs alone lose capitalisation/spaces) $originalNames = []; foreach (get_all_posts(false) as $post) { foreach (($post['tags'] ?? []) as $tag) { $slug = normalize_tag($tag); if (!isset($originalNames[$slug])) { $originalNames[$slug] = $tag; } } } // Sort alphabetically by display name uksort($tagCounts, function (string $a, string $b) use ($originalNames): int { return strcasecmp($originalNames[$a] ?? $a, $originalNames[$b] ?? $b); }); $maxCount = $tagCounts ? max($tagCounts) : 1; $minCount = $tagCounts ? min($tagCounts) : 1; $range = $maxCount > $minCount ? $maxCount - $minCount : 1; require PUREBLOG_BASE_PATH . '/includes/header.php'; render_masthead_layout($config, ['page' => null]); ?>

Tag Cloud

No tags found.

$count): $name = $originalNames[$slug] ?? $slug; $ratio = ($count - $minCount) / $range; $fontSize = round(0.85 + $ratio * 1.4, 2); $postWord = $count === 1 ? 'post' : 'posts'; echo '' . e($name) . '(' . e((string) $count) . ')' . '' . '  '; endforeach; ?>

null]); ?>