Skip to content

Commit 13fc236

Browse files
committed
feat: better inter-blog navigation
1 parent 9d7e5a8 commit 13fc236

4 files changed

Lines changed: 26 additions & 16 deletions

File tree

‎archive.html‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,19 @@
99

1010
<section class="posts">
1111

12+
<ul class="c-nav-secondary" id="section:about">
13+
<li class="c-nav-secondary__item"><a href="/blog/" class="c-nav-secondary__link is-current">All</a></li>
14+
<li class="c-nav-secondary__item"><a href="/blog/category/" class="c-nav-secondary__link">Categories</a></li>
15+
<li class="c-nav-secondary__item"><a href="/blog/tags/" class="c-nav-secondary__link">Tags</a></li>
16+
</ul>
17+
1218
{% assign random = site.time | date: "%s%N" | modulo: site.posts.size %}
1319

1420
<p>This is the full archive of everything I’ve published here:
1521
<b>{{ site.posts | size }}</b> articles on web performance, site-speed,
1622
Core Web Vitals, caching, browser behaviour, and the occasional older CSS
1723
piece.</p>
1824

19-
<ul class="c-nav-secondary" id="section:about">
20-
<li class="c-nav-secondary__item"><a href="/blog/category/" class="c-nav-secondary__link">Categories</a></li>
21-
<li class="c-nav-secondary__item"><a href="/blog/tags/" class="c-nav-secondary__link">Tags</a></li>
22-
</ul>
23-
2425
<p>If you’d rather start somewhere less chronological, try
2526
<a href="{{ site.posts[random].url }}"><cite>{{ site.posts[random].title }}</cite></a>
2627
<small>(<time>{{ site.posts[random].date | date: "%Y" }}</time>)</small>

‎blog.html‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,19 @@
88

99
<section class="posts">
1010

11+
<ul class="c-nav-secondary" id="section:about">
12+
<li class="c-nav-secondary__item"><a href="/blog/" class="c-nav-secondary__link is-current">All</a></li>
13+
<li class="c-nav-secondary__item"><a href="/blog/category/" class="c-nav-secondary__link">Categories</a></li>
14+
<li class="c-nav-secondary__item"><a href="/blog/tags/" class="c-nav-secondary__link">Tags</a></li>
15+
</ul>
16+
1117
{% assign random = site.time | date: "%s%N" | modulo: site.posts.size %}
1218

1319
<p>This is the full archive of everything I’ve published here:
1420
<b>{{ site.posts | size }}</b> articles on web performance, site-speed,
1521
Core Web Vitals, caching, browser behaviour, and the occasional older CSS
1622
piece.</p>
1723

18-
<ul class="c-nav-secondary" id="section:about">
19-
<li class="c-nav-secondary__item"><a href="/blog/category/" class="c-nav-secondary__link">Categories</a></li>
20-
<li class="c-nav-secondary__item"><a href="/blog/tags/" class="c-nav-secondary__link">Tags</a></li>
21-
</ul>
22-
2324
<p>If you’d rather start somewhere less chronological, try
2425
<a href="{{ site.posts[random].url }}"><cite>{{ site.posts[random].title }}</cite></a>
2526
<small>(<time>{{ site.posts[random].date | date: "%Y" }}</time>)</small>

‎category/index.html‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
---
22
layout: page
3-
title: Categories
3+
title: CSS Wizardry Blog Categories
44
permalink: /blog/category/
55
meta: "Browse by subject: web performance, front-end development, tooling, the business of consulting, and everything else written here."
66
---
77

8-
<p><a href="/blog/">« All posts</a></p>
8+
<ul class="c-nav-secondary" id="section:about">
9+
<li class="c-nav-secondary__item"><a href="/blog/" class="c-nav-secondary__link">All</a></li>
10+
<li class="c-nav-secondary__item"><a href="/blog/category/" class="c-nav-secondary__link is-current">Categories</a></li>
11+
<li class="c-nav-secondary__item"><a href="/blog/tags/" class="c-nav-secondary__link">Tags</a></li>
12+
</ul>
913

1014
{% assign category_pages = site.pages | where_exp: "item", "item.category" | sort: "category" %}
1115
{% assign category_count = category_pages | size %}
@@ -19,7 +23,7 @@
1923
<a href="{{ '/blog/tags/' | relative_url }}">tags</a> go a good deal
2024
deeper.</p>
2125

22-
<ul>
26+
<ul class=o-list-columnar>
2327
{% for category_page in category_pages %}
2428
<li><a href="{{ category_page.url | relative_url }}">{{ category_page.category }}</a></li>
2529
{% endfor %}

‎tag/index.html‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
---
22
layout: page
3-
title: Tags
3+
title: CSS Wizardry Blog Tags
44
permalink: /blog/tags/
55
meta: "Every subject covered on CSS Wizardry, from Core Web Vitals and caching to CSS, RUM, and the browser internals sitting underneath them."
66
---
77

8-
<p><a href="/blog/">« All posts</a></p>
8+
<ul class="c-nav-secondary" id="section:about">
9+
<li class="c-nav-secondary__item"><a href="/blog/" class="c-nav-secondary__link">All</a></li>
10+
<li class="c-nav-secondary__item"><a href="/blog/category/" class="c-nav-secondary__link">Categories</a></li>
11+
<li class="c-nav-secondary__item"><a href="/blog/tags/" class="c-nav-secondary__link is-current">Tags</a></li>
12+
</ul>
913

1014
{% assign tag_pages = site.pages | where_exp: "item", "item.tag" | sort: "tag" %}
1115
{% assign tag_count = tag_pages | size %}
@@ -18,7 +22,7 @@
1822
Wizardry. If you’d rather browse by broader subject, try the
1923
<a href="{{ '/blog/category/' | relative_url }}">categories</a> instead.</p>
2024

21-
<ul>
25+
<ul class=o-list-columnar>
2226
{% for tag_page in tag_pages %}
2327
<li><a href="{{ tag_page.url | relative_url }}">{{ tag_page.tag }}</a></li>
2428
{% endfor %}

0 commit comments

Comments
 (0)