===============
== bacardi55 ==
===============
ἕν οἶδα ὅτι οὐδὲν οἶδα

Adding responses from others

- Permalink

Some posts I’m writing are part of a discussion with other bloggers. Either the discussion started elsewhere and I decided to participate or responses to a post I wrote.

When I participate in another discussion, I often add links to the external posts that inspired that response. But for posts published later, it is “too late” as I almost never edit old posts. It is the same for responses I receive to my own post, as they (by definition) are published after mine.

To change this, I decided to add related posts I enjoyed reading at the end of my post. It doesn’t mean I’m going to add every posts participating in the discussion, only the one I liked reading. As I said in my post “No interactions / UGC to see here…”, I don’t want something fully automated as I want to always decide what is displayed on my site. It means that the process has to be somewhat manual.

I could have simply decided to edit said post and add a list in the markdown file at the end, but I didn’t like that idea because:

  • It would have seem that it was part of the post
  • I couldn’t theme it a bit differently
  • It was not an elegant solution (according to my own weird standards :P)

So I decided to add the info in my frontmatter area, eg:

+++
title = "Do people IRL know you have a blog?"
author = ["bacardi55"]
date = 2024-07-01
tags = ["blog"]
categories = ["life", "blog"]
draft = false
responses = ["https://sarajaksa.eu/2024/07/do-people-in-real-life-know-i-have-a-blog/", "https://alexsirac.com/do-people-irl-know-you-have-a-blog/"]
+++

By doing so, I can then use the responses array in anyway I like within my template files.

As I have a partial template for anything added after the article itself (if the article has been shared with indienews, if it is part of a series, etc…), I simply added in that template some small code to list the responses parameter if it exist. If it does, it will generate a simple list:

[…]
<div>
  <p>Interesting posts from the community:</p>
  <ul>
    {{ range . }}
      <li><a href="{{ . }}">{{ . }}</a></li>
    {{ end }}
  </ul>
</div>
{{- end -}}
[…]

You can see the result in either the post or the “RE: To Blogroll, or to not?” or “Do people IRL know you have a blog?” posts.

Bonus: if like me you are using ox-hugo to export from orgmode to your hugo directory (in markdown), this is how I’m adding this custom frontmatter array:

:PROPERTIES:
:EXPORT_FILE_NAME: do-people-irl-know-you-have-a-blog
:EXPORT_DATE: 2024-07-01
:EXPORT_HUGO_CUSTOM_FRONT_MATTER: :responses ["https://sarajaksa.eu/2024/07/do-people-in-real-life-know-i-have-a-blog/" "https://alexsirac.com/do-people-irl-know-you-have-a-blog/" "https://notes.jeddacp.com/a-separation-of-spaces/"]
:END:

We’ll see how much I’m going to use this (or not) :).


Contact

If you find any issue or have any question about this article, feel free to reach out to me via webmentions, email, mastodon, matrix or even IRC, see the About page for details.