commit c3ed7e73dd58ef0ede10a0a5c12cef6f00b93bca
parent cb4a4f5266a1764234840e0944abc7c4fb17d356
Author: oscarbenedito <oscar@oscarbenedito.com>
Date: Tue, 7 Apr 2020 18:08:56 +0200
Post dates can now be more precise using the frontmatter
Diffstat:
4 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/config.toml b/config.toml
@@ -23,7 +23,8 @@ disableKinds = "taxonomyTerm"
tags = "/blog/tags/:slug/"
[frontmatter]
- date = [":filename", ":default"]
+ date = ["date", ":filename", ":default"]
+ lastmod = [":default", ":filename"]
[markup.goldmark.renderer]
unsafe = true # This just allows HTML on Markdown, unsafe here just means that if everyone could edit your Markdown, someone could put malicious JS on it.
diff --git a/content/blog/2019-12-06-composer.md b/content/blog/2019-12-06-composer.md
@@ -2,7 +2,7 @@
title: "Designing a composing interface"
categories: technology
tags: ["FOSS", "Software", "DIY", "Website"]
-lastmod: 2019-12-06
+lastmod: 2019-12-06T01:00:00+00:00
---
To write my blog posts, I use Markdown, a useful language to write simple fragments of text. The text is then "compiled" into HTML, which is then served as a webpage. Since Markdown files are plain text files, I mostly have used plain text editors in the past to write my posts, and I have had a decent experience with them. A week ago I was trying [WriteFreely](https://writefreely.org/) and the difference between their composing user interface and a text editor is very noticeable. I have read people say they love writing in Vim or Emacs, but for me, something more aesthetic is more suited.
diff --git a/layouts/_default/rss.xml b/layouts/_default/rss.xml
@@ -31,8 +31,7 @@
<email>{{ . }}</email>{{ end }}
</author>{{ end }}
<published>{{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</published>
- {{ if eq (.Lastmod.Format "2006-01-02") "0001-01-01" }}<updated>{{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</updated>
- {{- else }}<updated>{{ .Lastmod.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</updated>{{ end }}
+ <updated>{{ .Lastmod.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</updated>
<content type="html">{{ .Content | html }}</content>
</entry>{{ end }}
</feed>
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
@@ -7,7 +7,7 @@
<article class="h-entry">
<header>
<h1 class="post-title p-name">{{ .Title }}</h1>
- <div class="post-meta">{{ with .Params.categories }}<a class="p-category" style="color: var(--secondary-text-color)" href="{{ "blog/categories/" | relURL }}{{ . | urlize }}">{{ . | title }}</a> · {{ end }}<data class="dt-published" datetime="{{ .Date.Format "2006-01-02" }}">{{ .Date.Format "January 2, 2006" }}</data>{{ if .Lastmod }} (last modified on <data class="dt-updated" datetime="{{ .Lastmod.Format "2006-01-02" }}">{{ .Lastmod.Format "January 2, 2006" }}</data>){{ end }}
+ <div class="post-meta">{{ with .Params.categories }}<a class="p-category" style="color: var(--secondary-text-color)" href="{{ "blog/categories/" | relURL }}{{ . | urlize }}">{{ . | title }}</a> · {{ end }}<data class="dt-published" datetime="{{ .Date.Format "2006-01-02" }}">{{ .Date.Format "January 2, 2006" }}</data>{{ if ne .Lastmod .Date }} (last modified on <data class="dt-updated" datetime="{{ .Lastmod.Format "2006-01-02" }}">{{ .Lastmod.Format "January 2, 2006" }}</data>){{ end }}
</div>
</header>
<div class="post-content e-content">{{ .Content }}</div>