From 85d82f4dfce3f2b791cffb6e3bcf70e0d0c6df25 Mon Sep 17 00:00:00 2001 From: Alexis Hovorka Date: Tue, 25 Oct 2022 10:59:23 -0600 Subject: [feat] Add post dates --- layouts/post.njk | 4 +++- posts/feed.njk | 1 + posts/history.njk | 2 ++ posts/index.njk | 2 ++ static/style.css | 14 +++++++++++--- 5 files changed, 19 insertions(+), 4 deletions(-) diff --git a/layouts/post.njk b/layouts/post.njk index 0c0e4a9..53deceb 100644 --- a/layouts/post.njk +++ b/layouts/post.njk @@ -4,10 +4,12 @@ layout: page.njk

{{ title }}

+ {%- set postDate = date.toISOString().slice(0,10) %} +

{%- if heroImg %} {{ heroImgAlt }} - {% endif -%} + {%- endif %} {{ content | safe }} diff --git a/posts/feed.njk b/posts/feed.njk index 1ad22fa..fc3abd7 100644 --- a/posts/feed.njk +++ b/posts/feed.njk @@ -23,6 +23,7 @@ {{ post.data.title }} + {% set postDate = post.date.setUTCHours(7) -%} {{ post.date | dateToRfc3339 }} {{ absolutePostUrl }} Read the full post online

]]>
diff --git a/posts/history.njk b/posts/history.njk index 76fbcd0..c3cdc50 100644 --- a/posts/history.njk +++ b/posts/history.njk @@ -16,6 +16,8 @@

{{ post.data.title }}

+ {%- set postDate = post.date.toISOString().slice(0,10) %} + {{ post | excerpt | safe }}
{% endfor %} diff --git a/posts/index.njk b/posts/index.njk index f695075..64ea7a6 100644 --- a/posts/index.njk +++ b/posts/index.njk @@ -13,6 +13,8 @@ {% set post = collections.all.slice(-1)[0] -%}

{{ post.data.title }}

+ {%- set postDate = post.date.toISOString().slice(0,10) %} + {{ post.templateContent | fixAnchors(post.url) | safe }} diff --git a/static/style.css b/static/style.css index 8ac1f13..64973ab 100644 --- a/static/style.css +++ b/static/style.css @@ -126,6 +126,17 @@ main { main * { margin: 1rem 0 } +h1, h1 * { font-size: 26px } +h2, h2 * { font-size: 22px } + +p.post-date { + margin: -1rem 0 -.2rem; +} +p.post-date * { + font-size: 15px; + color: #999; +} + [lang=jpn], [lang=jpn] * { font-size: 17px; } @@ -193,9 +204,6 @@ hr { border-top: .5px solid rgba(0,0,0,.2); } -h1, h1 * { font-size: 26px } -h2, h2 * { font-size: 22px } - img:not(.emoji) { display: block; max-width: 100%; -- cgit v1.2.3-54-g00ecf