Skip to content

Commit b6f9069

Browse files
committed
Add a dedicated Blog section
1 parent 7ccb66b commit b6f9069

3 files changed

Lines changed: 61 additions & 0 deletions

File tree

config.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ nav_links = [
3333
{ path = "/", title = "Home" },
3434
{ path = "/articles", title = "Articles" },
3535
{ path = "/demos", title = "Demos" },
36+
{ path = "/blog", title = "Blog" },
3637
{ path = "/tags", title = "Tags" },
3738
{ path = "/hiring", title = "Hiring" },
3839
]

content/blog/_index.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
+++
2+
title = "Blog"
3+
template = "blog/blog.html"
4+
[extra]
5+
subtitle = "Longer-form posts and write-ups"
6+
+++
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
{% extends "_layout.html" %}
2+
{% import "components/_badge.html" as badge_macro %}
3+
4+
{% block content %}
5+
{% set blog = get_taxonomy_term(kind="tags", term="blog") %}
6+
<article class="w-full">
7+
<table class="w-full">
8+
<thead>
9+
<tr>
10+
<th></th>
11+
<th class="text-left">
12+
<h1 class="m-2 p-2 inline-block font-bold text-2xl">{{ section.title }}</h1>
13+
<p class="m-2 p-2 inline-block font-normal dark:text-white text-black">
14+
{{ section.extra.subtitle }}
15+
</p>
16+
<p class="m-2 p-2">
17+
<a href="/atom.xml"
18+
class="inline-block text-orange-500 hover:text-orange-600 dark:text-orange-500 dark:hover:text-orange-400 underline hover:no-underline"
19+
title="Subscribe to Atom feed">
20+
Atom
21+
</a>
22+
<span class="text-white">&middot;</span>
23+
<a href="/rss.xml"
24+
class="inline-block text-orange-500 hover:text-orange-600 dark:text-orange-500 dark:hover:text-orange-400 underline hover:no-underline"
25+
title="Subscribe to RSS feed">
26+
RSS
27+
</a>
28+
</p>
29+
</th>
30+
<th></th>
31+
</tr>
32+
</thead>
33+
<tbody>
34+
{% for post in blog.pages %}
35+
<tr class="leading-10 align-top">
36+
<td class="w-1/6 p-0.5 pr-2 pt-4 text-right dark:text-white font-mono text-sm">
37+
{{ post.date }}
38+
</td>
39+
<td class="w-4/6 p-2 pt-4 pb-4 border-b dark:border-neutral-800">
40+
<a class="underline hover:no-underline dark:text-orange-500 dark:hover:text-orange-500 dark:hover:bg-neutral-900 font-bold"
41+
href="{{ post.permalink | safe }}">{{ post.title }}</a>
42+
{% if post.description %}
43+
<p class="dark:text-neutral-300 text-sm leading-6 mt-1">{{ post.description }}</p>
44+
{% endif %}
45+
</td>
46+
<td class="pt-4">
47+
{{ badge_macro::badge(href="/tags/blog", title="Blog") }}
48+
</td>
49+
</tr>
50+
{% endfor %}
51+
</tbody>
52+
</table>
53+
</article>
54+
{% endblock content %}

0 commit comments

Comments
 (0)