Skip to content

Commit

Permalink
Nicer post dates, adding the newsletter to the nav
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanlong committed Aug 4, 2023
1 parent b947fb9 commit 45ecdf8
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 5 deletions.
5 changes: 3 additions & 2 deletions _includes/layouts/base.njk
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,15 @@
</main>

<footer class="footer full w-full flex flex-col-to-row justify-between items-center px-1rem py-1 items-center mt-content gap-1">
<p class="color-reduced no-shrink font-small m-0"><a class="color-reduced" href="https://creativecommons.org/licenses/by-nc/4.0/">CC BY-NC-SA 4.0</a> 2023 &copy; Nathan Long.</p>
<p class="color-reduced font-small m-0"><a class="color-reduced" href="https://creativecommons.org/licenses/by-nc/4.0/">CC BY-NC-SA 4.0</a> 2023 &copy; Nathan Long.</p>

<p class="color-reduced font-small m-0 text-center">Signup for <a href="{{ '/newsletter/' | url }}">my weekly newsletter</a> for weekly net noodlings.</p>

<nav class="nav-footer no-shrink">
<menu class="nav m-0 p-0 flex flex-row list-none space-x-1">
{%- for entry in collections.all | eleventyNavigation %}
<li class="font-small"><a class="decoration-none" href="{{ entry.url | url }}">{{ entry.title }}</a></li>
{%- endfor %}
<li class="font-small"><a class="decoration-none" href="{{ '/newsletter' | url }}">Newsletter</a></li>
<li class="font-small"><a class="decoration-none" href="{{ '/feed/feed.xml' | url }}">RSS</a></li>
</menu>
</footer>
Expand Down
2 changes: 1 addition & 1 deletion _includes/layouts/post.njk
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ bodyClass: radial-mid
---

<div class="mt-content feature text-center mb-2">
<time class="uppercase text-small font-mono" datetime="{{ page.date | htmlDateString }}">{{ page.date | htmlDateString }}</time>
<time class="text-small font-mono" datetime="{{ page.date | htmlDateString }}">{{ page.date | readableDate }}</time>
<h1 class="mb-0">{{ title }}</h1>
<span class="inline-block">
{%- for tag in tags | filterTagList | sort() %}
Expand Down
2 changes: 1 addition & 1 deletion _includes/postslist.njk
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<a href="{{ tagUrl | url }}" class="post-tag py-1/2">{{ tag }}</a>
{% endfor %}
</span>
<time class="postlist-date uppercase text-small font-mono" datetime="{{ post.date | htmlDateString }}">{{ post.date | htmlDateString }}</time>
<time class="postlist-date font-xsmall font-mono" datetime="{{ post.date | htmlDateString }}">{{ post.date | readableDate }}</time>
</p>
</li>
{% endfor %}
Expand Down
4 changes: 4 additions & 0 deletions content/newsletter.njk
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
layout: layouts/full.njk
bodyClass: radial-mid
permalink: /newsletter/
eleventyNavigation:
key: newsletter
title: Newsletter
order: 4
---

<section class="mt-content text-center">
Expand Down
2 changes: 1 addition & 1 deletion eleventy.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ module.exports = function(eleventyConfig) {
// Filters
eleventyConfig.addFilter("readableDate", (dateObj, format, zone) => {
// Formatting tokens for Luxon: https://moment.github.io/luxon/#/formatting?id=table-of-tokens
return DateTime.fromJSDate(dateObj, { zone: zone || "utc" }).toFormat(format || "dd LLLL yyyy");
return DateTime.fromJSDate(dateObj, { zone: zone || "utc" }).toFormat(format || "LLLL dd, yyyy");
});

eleventyConfig.addFilter('htmlDateString', (dateObj) => {
Expand Down

0 comments on commit 45ecdf8

Please sign in to comment.