Add date and author to essay template (#1654)

Update the static site generator to include the date and author
automatically as part of the essays. I made a couple changes to the
underlying static structure to make this a little more seamless,
including:

* New "essay.html" template for posts in `/essays`
* Added an author taxonomy (can eventually be author pages)
* Added Carson as the author of all the existing esssays
* Cleaned up manual date entires, where they existed

All this will make it easier to publish guest essays and sort the essays
(chronologically, by topic, or by author) as the essay base expands.
This commit is contained in:
Alexander Petros 2023-08-01 15:26:32 -04:00 committed by GitHub
parent 2eaa902310
commit 6fddb9b8bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
25 changed files with 158 additions and 104 deletions

View File

@ -7,7 +7,8 @@ build_search_index = false
generate_feed = true
taxonomies = [
{ name = "tag", render = false, feed = true }
{ name = "tag", render = false, feed = true },
{ name = "author", render = false, feed = false }
]
[markdown]

View File

@ -3,6 +3,7 @@ title = "10 Tips For Building SSR/HDA applications"
date = 2022-06-13
updated = 2023-06-13
[taxonomies]
author = ["Carson Gross"]
tag = ["posts"]
+++

View File

@ -1,6 +1,7 @@
+++
title = "Essays"
insert_anchor_links = "left"
page_template = "essay.html"
+++
### Hypermedia and REST

View File

@ -3,6 +3,7 @@ title = "A Real World React -> htmx Port"
date = 2022-09-29
updated = 2022-10-15
[taxonomies]
author = ["Carson Gross"]
tag = ["posts"]
+++

View File

@ -3,6 +3,7 @@ title = "A Response To "Have Single-Page Apps Ruined the Web?""
date = 2021-12-24
updated = 2022-05-27
[taxonomies]
author = ["Carson Gross"]
tag = ["posts"]
+++

View File

@ -3,6 +3,7 @@ title = "Architectural Sympathy"
date = 2023-04-06
updated = 2023-04-06
[taxonomies]
author = ["Carson Gross"]
+++

View File

@ -3,6 +3,7 @@ title = "Complexity Budget"
date = 2020-10-29
updated = 2022-02-06
[taxonomies]
author = ["Carson Gross"]
tag = ["posts"]
+++

View File

@ -3,9 +3,11 @@ title = "HATEOAS"
date = 2021-10-16
updated = 2022-02-06
[taxonomies]
author = ["Carson Gross"]
tag = ["posts"]
[extra]
show_title = false
show_author = false
+++
<link rel="preconnect" href="https://fonts.googleapis.com">

View File

@ -1,14 +1,12 @@
+++
title = "How Did REST Come To Mean The Opposite of REST?"
author = "Carson Gross <carson@bigsky.software>"
date = 2022-07-18
updated = 2022-11-26
[taxonomies]
author = ["Carson Gross"]
tag = ["posts"]
+++
<h4>18 July 2022</h4>
<style>
pre {
margin: 32px !important;

View File

@ -3,6 +3,7 @@ title = "Hypermedia APIs vs. Data APIs"
date = 2021-07-17
updated = 2022-04-07
[taxonomies]
author = ["Carson Gross"]
tag = ["posts"]
+++

View File

@ -3,6 +3,7 @@ title = "Hypermedia Clients"
date = 2023-01-28
updated = 2023-01-29
[taxonomies]
author = ["Carson Gross"]
tag = ["posts"]
+++

View File

@ -3,6 +3,7 @@ title = "Hypermedia-Driven Applications"
date = 2022-02-06
updated = 2022-10-18
[taxonomies]
author = ["Carson Gross"]
tag = ["posts"]
+++

View File

@ -3,6 +3,7 @@ title = "Hypermedia-Friendly Scripting"
date = 2022-11-17
updated = 2022-11-29
[taxonomies]
author = ["Carson Gross"]
tag = ["posts"]
+++

View File

@ -2,6 +2,7 @@
title = "Hypermedia On Whatever you'd Like"
date = 2023-05-23
[taxonomies]
author = ["Carson Gross"]
tag = ["posts"]
+++

View File

@ -3,6 +3,7 @@ title = "Locality of Behaviour (LoB)"
date = 2020-05-29
updated = 2023-01-20
[taxonomies]
author = ["Carson Gross"]
tag = ["posts"]
+++

View File

@ -3,9 +3,11 @@ title = "REST Copypasta"
date = 2023-06-26
updated = 2023-06-26
[taxonomies]
author = ["Carson Gross"]
tag = ["posts"]
[extra]
show_title = false
show_author = false
+++
## REST copy-pastas

View File

@ -3,6 +3,7 @@ title = "SPA Alternative"
date = 2020-10-29
updated = 2022-02-06
[taxonomies]
author = ["Carson Gross"]
tag = ["posts"]
+++

View File

@ -3,6 +3,7 @@ title = "Splitting Your Data &amp; Application APIs: Going Further"
date = 2021-09-16
updated = 2022-02-06
[taxonomies]
author = ["Carson Gross"]
tag = ["posts"]
+++

View File

@ -3,6 +3,7 @@ title = "Template Fragments"
date = 2022-08-03
updated = 2023-03-18
[taxonomies]
author = ["Carson Gross"]
tag = ["posts"]
+++

View File

@ -3,6 +3,7 @@ title = "Two Approaches To Decoupling"
date = 2022-05-01
updated = 2022-05-01
[taxonomies]
author = ["Carson Gross"]
tag = ["posts"]
+++

View File

@ -3,6 +3,7 @@ template = "demo.html"
title = "View Transitions"
date = 2023-04-11
[taxonomies]
author = ["Carson Gross"]
tag = ["posts"]
+++

View File

@ -3,6 +3,7 @@ title = "When Should You Use Hypermedia?"
date = 2022-10-23
updated = 2023-02-03
[taxonomies]
author = ["Carson Gross"]
tag = ["posts"]
+++

View File

@ -129,6 +129,10 @@ table {
line-height: 1em;
}
time {
font-weight: bold;
}
a {
text-decoration: none;
color: var(--midBlue)

View File

@ -0,0 +1,34 @@
{% extends "base.html" %}
{% block title %}
{% if page.title -%}
{% set html_title = "&lt;/&gt; htmx ~ " ~ page.title -%}
{% endif -%}
{% endblock title %}
{% block content %}
{% if page.extra and page.extra.show_title is defined -%}
{% set show_title = page.extra.show_title -%}
{% else -%}
{% set show_title = true -%}
{% endif -%}
{% if page.extra and page.extra.show_author is defined -%}
{% set show_author = page.extra.show_author -%}
{% else -%}
{% set show_author = true -%}
{% endif -%}
{% set page_title = page.title -%}
{% if show_title %}<h1>{{ page_title | safe }}</h1>{% endif %}
{% if show_author and page.taxonomies.author %}
<address>{{ page.taxonomies.author | join(sep=", ") }}</address>
<time>{{ page.date | date(format="%B %d, %Y") }}</time>
{% endif %}
{{ page.content | safe }}
<div style="padding-top: 120px;padding-bottom:40px;text-align: center">
&lt;/&gt;
</div>
{% endblock content %}

View File

@ -27,9 +27,4 @@
{% endif -%}
{% if show_title %}<h1>{{ page_title | safe }}</h1>{% endif %}
{{ page.content | safe }}
{% if page.path is starting_with("/essays/") -%}
<div style="padding-top: 120px;padding-bottom:40px;text-align: center">
&lt;/&gt;
</div>
{% endif -%}
{% endblock content %}