Skip to content

Commit 2a38a32

Browse files
committed
Add support for tags to blog posts
Adds simple tag bubbles that can be added to blog posts. In the future we may want to make these selectable for filtering and include a search bar as was done for swift-evolution.
1 parent 0126d8c commit 2a38a32

File tree

4 files changed

+56
-16
lines changed

4 files changed

+56
-16
lines changed

_layouts/post.html

+10-1
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,17 @@
55
<article class="post">
66
<header>
77
<h1>{{ page.title }}</h1>
8+
<div class="subtitle">
9+
<time pubdate datetime="{{ page.date | date_to_xmlschema }}">
10+
{{ page.date | date: "%B %-d, %Y" }}
11+
</time>
812

9-
<time pubdate datetime="{{ page.date | date_to_xmlschema }}">{{ page.date | date: "%B %-d, %Y" }}</time>
13+
<div class="tags">
14+
{% for tag in page.tag %}
15+
<div class="tag"><span>{{ tag }}</span></div>
16+
{% endfor %}
17+
</div>
18+
</div>
1019
{% include authors.html authors=page.author %}
1120
</header>
1221

_posts/2023-11-06-swift-5.9-backtraces.md

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ published: true
44
date: 2023-11-08 10:00:00
55
title: On-Crash Backtraces in Swift
66
author: [al45tair]
7+
tag: [swift 5.9, linux, debugging]
78
---
89

910
The new Swift 5.9 release contains a number of helpful, new features for debugging code, including an out-of-process, interactive

assets/stylesheets/_screen.scss

+34-14
Original file line numberDiff line numberDiff line change
@@ -490,21 +490,41 @@ article {
490490
padding-top: 0em;
491491
}
492492

493-
time {
494-
display: block;
495-
text-transform: uppercase;
496-
font-size: 14px;
497-
font-weight: 400;
498-
color: var(--color-figure-gray-tertiary);
499-
margin-right: 3em;
500-
margin-bottom: 2em;
501-
}
493+
.subtitle {
494+
display: flex;
495+
justify-content: space-between;
496+
margin-bottom: 1em;
502497

503-
.tags {
504-
display: block;
505-
font-size: 12px;
506-
font-weight: 400;
507-
margin-top: 0;
498+
time {
499+
flex-shrink: 0;
500+
margin-top: 0.2em + 0.15em;
501+
text-transform: uppercase;
502+
font-size: 0.8em;
503+
font-weight: 400;
504+
color: var(--color-figure-gray-tertiary);
505+
}
506+
507+
.tags {
508+
display: flex;
509+
flex-direction: row;
510+
/* Allow tags to wrap to additional lines */
511+
flex-wrap: wrap;
512+
/* Add a small gap between additional lines */
513+
gap: .4em;
514+
/* Align to trailing edge */
515+
justify-content: flex-end;
516+
517+
.tag {
518+
text-transform: uppercase;
519+
font-size: 0.8em;
520+
font-weight: 400;
521+
margin-left: 0.5em; /* Adjust margin as needed for spacing between tags */
522+
color: var(--color-figure-gray-tertiary);
523+
border: 0.15em solid var(--color-nav-rule);
524+
border-radius: .5rem;
525+
padding: .15em .4em;
526+
}
527+
}
508528
}
509529
}
510530

blog/index.html

+11-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,17 @@
88
<article id="{{ post.id }}" class="summary">
99
<header>
1010
<h2 class="title"><a href="{{ post.url }}">{{ post.title }}</a></h2>
11-
<time pubdate datetime="{{ post.date | date_to_xmlschema }}">{{ post.date | date: "%B %-d, %Y" }}</time>
11+
<div class="subtitle">
12+
<time pubdate datetime="{{ post.date | date_to_xmlschema }}">
13+
{{ post.date | date: "%B %-d, %Y" }}
14+
</time>
15+
16+
<div class="tags">
17+
{% for tag in post.tag %}
18+
<div class="tag"><span>{{ tag }}</span></div>
19+
{% endfor %}
20+
</div>
21+
</div>
1222
</header>
1323
<section class="excerpt">
1424
{{ post.excerpt }}

0 commit comments

Comments
 (0)