Repository navigation
Expand file tree
/
Copy pathcategory.html
More file actions
45 lines (42 loc) · 1.78 KB
/
Copy pathcategory.html
File metadata and controls
45 lines (42 loc) · 1.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
---
layout: default
title: Categories
permalink: /categories/
description: "Browse all blog post categories on Richard Djarbeng's website. Find articles organized by topics including AI, technology, software development, space, and more."
---
<div class="categories-page">
<h1>Categories</h1>
<p style="text-align: center; margin-bottom: 20px;">
<a href="/" class="about-link btn" style="margin-right: 10px;">Return Home🏠</a>
<a href="/tags/" class="about-link">View Tags 🏷️</a>
</p>
{%- comment -%}
Technical posts and personal posts each have their own small set of
categories (see _category_info, field `section`). Tags are shared.
{%- endcomment -%}
{% assign sections = "technical,personal" | split: "," %}
{% for section in sections %}
<h2 class="section-title" style="text-align: center; margin-top: 40px;">
{% if section == "technical" %}Technical posts{% else %}Personal posts{% endif %}
</h2>
<ul class="category-grid">
{% for cat in site.categoryIndex %}
{% if section == "technical" and cat.technical == 0 %}{% continue %}{% endif %}
{% if section == "personal" and cat.personal == 0 %}{% continue %}{% endif %}
{% assign cat_size = cat.posts.size %}
{% assign cat_info = site.category_info | where: "slug", cat.slug | first %}
<li>
<a href="{{ cat.url }}" class="category-card">
<div class="category-card-header">
<span class="category-name">{{ cat.displayName }}</span>
<span class="category-count">{{ cat_size }} post{% if cat_size != 1 %}s{% endif %}</span>
</div>
{% if cat_info.description %}
<p class="category-card-desc">{{ cat_info.description | strip_html | truncate: 120 }}</p>
{% endif %}
</a>
</li>
{% endfor %}
</ul>
{% endfor %}
</div>