Prettier Blog Listings

The Jekyll’s introductory tutorial suggests using…

<ul>
  {% for post in site.posts %}
    <li>
      <a href="{{ post.url }}">{{ post.title }}</a>
    </li>
  {% endfor %}
</ul>

…as liquid code to display a programmatically generated, bullet-pointed list of blog posts titles each with a link to the post in question.

However, a more useful list of blog posts titles can be generated with a little extra effort.

The following code block will generate a bullet-pointed list of posts with a link to the post in question. Next to the post title it will add the canonical date of the post – formatted in a human friendly style – and, below, will append a generated excerpt from the post to tease any potential reader.

<ul>
  {% for post in site.posts %}
    <li>
      <a href="{{ post.url }}">{{ post.title }}</a>  ({{ post.date| date: "%B %d, %Y" }})
      {{ post.excerpt }}
    </li>
  {% endfor %}
</ul>

The end result is something like this:

  • Photography (January 30, 2019)
    As part of moving away from other people’s flaky, terms-terms-of-use changing sites (cough… Flickr!) I have started to add various image galleries to this site.

Jekyll Problems

The Jekyll introductory tutorial encourages you to create all pages with a header block that includes the key pair ‘title: A Page Title’. An unfortunate downside to this is that, under the default theme, every page is now added to your site’s auto-generated header – something that, as your site grows, you are unlikely to want to do.

Fixing this is simple; to exclude a page from the site’s header just omit your ‘title: A Page Title’ key pair.

For example:

---
layout: page
title: Blog
permalink: /blog/
---

… would add the page ‘Blog’ to the header and…

---
layout: page
permalink: /blog/
---

…would see it omitted.

Owning the Means of Resolution

The first two blog posts on this site have concentrated on the technical aims of starting this website – to improve and expand my linux, nginx, and other associated skills.

Now it’s time to talk about another reason:

It’s been fairly obvious now that, after nearly two decades of tech expansion and growth combined – paradoxically – with the mass centralisation of user activity, there is a very good chance that, come the next tech recession, large chunks of people’s online presence risk being lost to the Official Reciever and the world’s various bankruptcy courts.

In some instances this may be a benefit – the loss of a million cringe-inducing MySpace profiles probably helps some sleep at night – but others (the slow slip of LiveJournal into the Russian sphere, the coming purge of millions of images on Flickr as various owners try – and fail – to make the site sustainable) qualify as material risks to online presences that may now stretch back two or more decades and provide value to the people concerned.

Operating my own domain allows me to hedge against these kind of events.

That’s not to say that this site will stay up – or will even always be available – but, thanks to the collapse in costs in personal hosting, I stand a far better chance of dictating the length of this site’s existence than I would were I to commit my content to someone else’s platform.

Domains name registration, DNS resolution services, hosting; these are all commodity activities that can be swapped at will – as long as I have the relevent authorisation.

And I will never have that relevent authorisation for Flickr.
Or Reddit.
Or LinkedIn.

Adventures in Jekyll

As part of relearning both linux and nginx, I need to create and manage content on this site. For this I will be using the Jekyll static templating application to pre-generate the pages I serve. I will be using generated but static pages for two important reasons:

  1. Jekyll with automatically generate a large amount of the dull, tedious html that makes a modern website – even a toy one such as this. We all have better things to do with our lives than handcraft sitemap.xml files.
  2. Serving static pages does not require a CMS – with the associated security and resource issues that come with dynamic content.