This page permanently redirects to gemini://gmi.bacardi55.io/blog/2024/02/20/automating-my-coffee-warning-on-long-article/.
Posted on 2024-02-20
While writing my 2 next very long posts (should be published soon), I had a fun and stupid idea: I have the tendency to alert at the start of a long blog post to tell the reader to maybe go get a coffee before starting reading… I have done this many time and while I started typing some similar intro in that next post, I decided to automate it as a good lazy person :).
It looks like this in dark mode:
And in light mode:
Similar to what I've done with [the old post warning], I edited the [MinIndie theme] to include a new article-precontent.html' partial just above the entry content and then created a custom
article-precontent.html' partial (see below it's content).
In the `single.html' file of the theme, I've added above the content itself:
{{- with .Site.Params.tagPostOlderThanXDays -}} {{- end -}} {{- partial "article-precontent.html" . -}}
The default `article-precontent.html' partial is empty.
My custom `article-precontent.html' partial is very similar to the old post one:
{{- with .Params.Coffee -}}
Nota: This post is tagged as a long post, meaning it may be better to prepare yourself a coffee or a drink of your choice before starting reading this page :).{{- end -}}
This will be displayed each time a post has `Coffee = 1' in the frontmatter section, for example for the article [IndieWeb adventure: First steps]:
+++ title = "IndieWeb adventure: First steps" author = ["Bacardi55"] date = 2024-01-29 tags = ["indieweb", "indienews", "blog"] draft = false indienews = 1 coffee = 1 +++
The update to the theme has also be pushed to sourcehut.
Now I don't have to manually type a sentence to tell my reader to get a drink at the start of long post… A very useless thing to add to this blog, but that made me smile a little, so that's a win :). I didn't edited any other post than the indieweb one to avoid raising old posts in rss readers, but going to use it now!
=> the old post warning | MinIndie theme | IndieWeb adventure: First steps
=> /gemlog/
=> Send me a gemini mention | send me an email! This content has been proxied by September (ba2dc).Proxy Information
text/gemini; lang=en