Files
indiekit-blog/categories.njk
Ricardo 96182cb1e4 fix: comprehensive mobile responsive design audit
- Make all headings responsive (text-2xl sm:text-3xl pattern)
- Make all section headings responsive (text-xl sm:text-2xl)
- Add responsive margins (mb-6 sm:mb-8 pattern)
- Fix flex layouts to stack on mobile (flex-col sm:flex-row)
- Make images responsive (w-20 sm:w-24 pattern)
- Add responsive padding (p-4 sm:p-6)
- Improve grid gaps for mobile (gap-3 sm:gap-4)
- Add CSS utilities for table overflow and touch scrolling
- Restyle 404 page with proper responsive design

Files updated: 22 template and CSS files across all pages

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 15:48:23 +01:00

70 lines
2.5 KiB
Plaintext

---
layout: layouts/base.njk
withSidebar: true
pagination:
data: collections.categories
size: 1
alias: category
permalink: "categories/{{ category | slugify }}/"
eleventyComputed:
title: "{{ category }}"
---
<div class="h-feed">
<h1 class="text-2xl sm:text-3xl font-bold text-surface-900 dark:text-surface-100 mb-2">{{ category }}</h1>
<p class="text-surface-600 dark:text-surface-400 mb-6 sm:mb-8">
Posts tagged with "{{ category }}".
</p>
{% set categoryPosts = [] %}
{% for post in collections.posts %}
{% if post.data.category %}
{% if post.data.category is string %}
{% if post.data.category == category %}
{% set categoryPosts = (categoryPosts.push(post), categoryPosts) %}
{% endif %}
{% else %}
{% if category in post.data.category %}
{% set categoryPosts = (categoryPosts.push(post), categoryPosts) %}
{% endif %}
{% endif %}
{% endif %}
{% endfor %}
{% if categoryPosts.length > 0 %}
<p class="text-sm text-surface-500 dark:text-surface-400 mb-4">{{ categoryPosts.length }} post{% if categoryPosts.length != 1 %}s{% endif %}</p>
<ul class="post-list">
{% for post in categoryPosts %}
<li class="h-entry post-card">
<div class="post-header">
<h2 class="text-xl font-semibold mb-1 flex-1">
<a class="p-name u-url text-surface-900 dark:text-surface-100 hover:text-primary-600 dark:hover:text-primary-400" href="{{ post.url }}">
{{ post.data.title or post.templateContent | striptags | truncate(60) or "Untitled" }}
</a>
</h2>
</div>
<div class="post-meta mt-2">
<time class="dt-published" datetime="{{ post.date | isoDate }}">
{{ post.date | dateDisplay }}
</time>
{% set postType = post.inputPath | replace("./content/", "") %}
{% set postType = postType.split("/")[0] %}
<span class="post-type">{{ postType }}</span>
</div>
<p class="p-summary text-surface-700 dark:text-surface-300 mt-3">
{{ post.templateContent | striptags | truncate(250) }}
</p>
<a href="{{ post.url }}" class="text-sm text-primary-600 dark:text-primary-400 hover:underline mt-3 inline-block">
View &rarr;
</a>
</li>
{% endfor %}
</ul>
{% else %}
<p class="text-surface-600 dark:text-surface-400">No posts found with this category.</p>
{% endif %}
<div class="mt-8">
<a href="/categories/" class="text-primary-600 dark:text-primary-400 hover:underline">&larr; All categories</a>
</div>
</div>