Skip to content

Commit 76a8d46

Browse files
committed
improve accessibility and typography
Add comprehensive accessibility improvements to Jekyll site layouts: - Add lang attribute to html element for screen readers - Replace div wrapper with semantic <nav> and <main> landmarks - Add skip-to-content link for keyboard navigation - Add aria-labels to navigation links - Use semantic list markup for navigation - Replace br tags with CSS margin-based spacing - Fix heading hierarchy (h1 → h2 progression in posts) - Remove duplicate h2 headings from post layouts Implement IBM Plex font family for improved typography: - Use IBM Plex Mono for code blocks, headings, and navigation - Use IBM Plex Sans for body text and general content - Apply monospace date formatting on index page These changes enhance usability for all users while maintaining visual design consistency.
1 parent 8fad2f9 commit 76a8d46

13 files changed

+100
-28
lines changed

_layouts/default.html

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!DOCTYPE html>
22

3-
<html>
3+
<html lang="en">
44
<head>
55
<title>{% if page.title %}Sourceless - {{ page.title }}{% else %}Sourceless{% endif %}</title>
66
<meta name="description" content="{{ page.summary | default: '' }}"/>
@@ -10,20 +10,29 @@
1010
<meta name="copyright" content="2020-{{ 'now' | date: '%Y' }} Laurence Pakenham-Smith"/>
1111
<meta name="robots" content="index"/>
1212
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
13+
<link rel="preconnect" href="https://fonts.googleapis.com"/>
14+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin/>
15+
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;700&family=IBM+Plex+Sans:wght@400;600&display=swap"/>
1316
<link rel="stylesheet" type="text/css" href="{{ '/assets/css/main.css' | relative_url }}"/>
1417
</head>
1518

1619
<body>
17-
<code id="content">
20+
<a class="skip-link" href="#main-content">Skip to content</a>
21+
<div id="content">
1822
<h1>sourceless</h1>
1923

20-
<a href="{{ '/' | relative_url }}">index</a>
21-
{% assign sorted_pages = site.pages | where_exp: "p", "p.nav_order" | sort: "nav_order" %}
22-
{% for p in sorted_pages %}
23-
<a href="{{ p.url | relative_url }}">{{ p.title }}</a>
24-
{% endfor %}
24+
<nav aria-label="Main navigation">
25+
<a href="{{ '/' | relative_url }}">index</a>
26+
{% assign sorted_pages = site.pages | where_exp: "p", "p.nav_order" | sort: "nav_order" %}
27+
{% for p in sorted_pages %}
28+
<a href="{{ p.url | relative_url }}">{{ p.title }}</a>
29+
{% endfor %}
30+
</nav>
2531

26-
{{ content }}
27-
</code>
32+
<main id="main-content">
33+
{% if page.title %}<h2>{{ page.title }}</h2>{% endif %}
34+
{{ content }}
35+
</main>
36+
</div>
2837
</body>
2938
</html>

_layouts/home.html

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
---
22
layout: default
33
---
4-
<br/>
5-
<br/>
6-
<br/>
4+
<ul class="post-list">
75
{% for post in site.posts %}
8-
{{ post.date | date: "%Y-%m-%d" }} <a href="{{ post.url | relative_url }}">{{ post.title }}</a><br />
6+
<li><span class="post-date">{{ post.date | date: "%Y-%m-%d" }}</span> <a href="{{ post.url | relative_url }}">{{ post.title }}</a></li>
97
{% endfor %}
8+
</ul>

_layouts/post.html

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@
22
layout: default
33
---
44
{{ content }}
5-
<br/>
6-
Posted {{ page.date | date: "%Y-%m-%d" }}
7-
<br/>
8-
<br/>
5+
<p class="post-meta">Posted {{ page.date | date: "%Y-%m-%d" }}</p>
6+
<nav class="post-nav" aria-label="Post navigation">
97
{% if page.previous %}
10-
<a href="{{ page.previous.url | relative_url }}">&larr; {{ page.previous.title }}</a>
8+
<a href="{{ page.previous.url | relative_url }}" aria-label="Previous post: {{ page.previous.title }}">&larr; {{ page.previous.title }}</a>
119
{% endif %}
1210
{% if page.next %}
13-
<a href="{{ page.next.url | relative_url }}">{{ page.next.title }} &rarr;</a>
11+
<a href="{{ page.next.url | relative_url }}" aria-label="Next post: {{ page.next.title }}">{{ page.next.title }} &rarr;</a>
1412
{% endif %}
13+
</nav>

_posts/2021-01-17-how-i-built-this-site.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ title: "Getting github pages to work with my custom site generator"
44
date: 2021-01-17
55
tags: [tutorial, guide, how]
66
---
7-
## Getting github pages to work with my custom site generator
87

98
So, I built a [crappy site generator](https://github.com/Sourceless/sourceless.github.io).
109
It's pretty bad, which is the result of some very targeted design decisions:

_posts/2021-03-19-the-documentation-triangle.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ title: "The Documentation Triangle"
44
date: 2021-03-19
55
tags: [documentation, self-documenting, documentation-as-code, opinion, triangle]
66
---
7-
## The Documentation Triangle (or, why code isn't self documenting)
87

98
At some point in your coding career, you've probably heard something like:
109

_posts/2022-06-19-relearning-to-learn.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ title: "Relearning to Learn"
44
date: 2022-06-19
55
tags: [learning, learning-to-learn]
66
---
7-
## Relearning to Learn
87

98
Many years ago, I took a test. It was the first step of our
109
"Learning to Learn" class. After answering a series of multiple

_posts/2022-06-22-perfect-isnt-good-enough.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ title: "Perfect isn't Good Enough"
44
date: 2022-06-22
55
tags: [perfect, perfection, good-enough, laziness]
66
---
7-
## Perfect isn't Good Enough
87

98
> Perfect is the enemy of the good
109

_posts/2022-07-07-the-continuous-delivery-test.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ title: "The Continuous Delivery Test"
44
date: 2022-07-07
55
tags: [joel-test, devops, continuous-delivery]
66
---
7-
## The Continuous Delivery Test
87

98
In 2000, Joel Spolsky published a piece on what he believed were the
109
key factors that separated high-performing teams from the rest, in a post titled

_posts/2022-07-29-put-ticket-ids-in-your-commit-messages.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ title: "Put Ticket IDs in your Commit Messages"
44
date: 2022-07-29
55
tags: [compliance, devops, continuous-delivery]
66
---
7-
## Put Ticket IDs in your Commit Messages
87

98
In my previous post [The Continuous Delivery Test](https://sourceless.org/posts/the-continuous-delivery-test.html)
109
I included a point:

_posts/2022-08-16-make-your-own-free-password-manager.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ title: "Make your own (free) password manager"
44
date: 2022-08-16
55
tags: [passwords, security, selfhost]
66
---
7-
## Make your own (free) password manager
87

98
> Before I say anything else, it should be noted that this solution requires
109
> a little bit of background knowledge to set up and use. At the very least

0 commit comments

Comments
 (0)