-- Leo's gemini proxy

-- Connecting to taoetc.org:1965...

-- Connected

-- Sending request

-- Meta line: 20 text/gemini

The other side of the newspaper clipping


One day, while looking at old newspaper clippings with my dad, he told me:


> The other side of the clipping is always more interesting than the clipping itself!


And while "always" was a bit of stretch, it was often true. It was fun turning the clipping around and reading the half-news that were captured by accident.


I decided to do something similar with my blog. My static generator has an "assistant" that fetches the current weather when I create a new post (even though it's currently not displayed anywhere). I used it as a template to write another "assistant" that fetches a random headline of the day, and stores it in a file called news.yaml.


Later, I can then incorporate this in my templates. The static generator loads all YAML files that live alongside a post (like news.yaml, or current_weather.yaml), and exposes them to the templates, eg:


Current weather: {{ post.metadata.current_weather.current_condition.weatherDesc.value }}

In this day: "{{ post.metadata.news.title }}"

For now, I'm just happy in keeping these headlines saved.


Edit: I've decided to only show the headlines when the post is older than 1 year.


Tags


blog

nefelibata

news


Categories


STEM


About


Published on 2021-10-21 03:30:36+00:00 by Beto Dealmeida <roberto@dealmeida.net>.


Go back to the main index

-- Response ended

-- Page fetched on Mon May 6 06:15:57 2024