duncanlock.net

Interesting things I found

  • There’s a fair bit of ‘Testing, 1, 2, 3’ type posts, especially early on
  • Author names aren’t trimmed, so they can have leading and trailing white-space and embedded newlines in them.
  • None of the early articles have categories - I think this feature was added later.
  • There’s a really long warm up period - almost a year, until May 2013 when things really take off.
Continue reading “Building Seance - a peek inside Medium.com”

The Pelican quickstart site that we created in Part 1 used the default theme - which you will probably want to change or, at least, customize. In this post I break down the Pelican theme I created for this site and show you exactly how it’s built. I’ll be going through each part of the theme in depth, explaining why I did things that way and how each part works.

The theme for this site is professional grade - high quality, polished and responsive. It puts the focus on the reader, is 100% easy to read and works flawlessly at any screen size, including mobiles & tablets. It also takes into account best practices for both social media and Problematic, check error messages! : :abbr:`SEO (Search Engine Optimization)`, so that you can make the most of your writing.

Unknown interpreted text …

Continue reading “How I built this website, using Pelican: Part 2 - Themes”

Compressing Limited Colour PNG images

Most of the .PNG files on this site are the ‘blueprint’ style diagrams, like this one:

Blueprint style diagram showing an optical microscope. The sample inside is magnified in a bubble to 2500 times
Figure 1. This illustration is a large 5.6MB SVG file, mostly because of the very detailed paisley pattern that I used. Exported to PNG - and then compressed using the process below, you can get this down to 118.5kB.

I create these in Inkscape as vector .SVG files & export them to bitmap .PNG files. I then re-compress them, to ensure that the image files that are used on the live website are as small & quick to load as possible.

As these diagrams have a fairly limited colour palette, I can get lots of extra compression by reducing the colour depth of the final .PNG files from the default 32bit (millions of colours) to 8bit (256 colours) - without any …

Continue reading “How I compress PNG files on this website”

reddit bots diagram
Figure 1. How much does a software bot weigh, anyway? Heavily modified & adapted from the original public domain robot on openclipart, posted by johnny_automatic.

reddit, the insanely popular internet community, had 71,435,935 unique visitors last month, with over 2,360,783 people logged in [1].

I say people - but it turns out that not all the denizens of reddit are human. There are also bots. Lots and lots of bots. How many? No-one really knows. [2]

This is an interesting and somewhat shadowy facet of the otherwise very public reddit community, so I thought I’d take a closer look…​

What is a reddit bot?

A reddit bot is no different from any other user, as far as reddit is concerned. The only difference is that rather than a human logging in to upvote cat pictures and …

Continue reading “A Marvellous & Incomplete Compendium of reddit Automatons & Bots”

Go through my config and explain each bit

Date based posts

ARTICLE_URL = 'blog/{date:%Y}/{date:%m}/{date:%d}/{slug}/'
ARTICLE_SAVE_AS = 'blog/{date:%Y}/{date:%m}/{date:%d}/{slug}/index.html'

YEAR_ARCHIVE_SAVE_AS = 'blog/{date:%Y}/index.html'
MONTH_ARCHIVE_SAVE_AS = 'blog/{date:%Y}/{date:%m}/index.html'
DAY_ARCHIVE_SAVE_AS = 'blog/{date:%Y}/{date:%m}/{date:%d}/index.html'

ARCHIVES_SAVE_AS = 'blog/index.html'

Gotchas

The config file is a python script

This is really great, once you get the hang of it, but for some reasons, the settings documented here aren’t in python syntax, so you can’t just copy & paste them. For example, these three settings from there :

AUTHOR
MARKUP (('rst', 'md'))
STATIC_PATHS (['images'])

need to look something like this, when you put them into your pelican …

Continue reading “How I built this website, using Pelican: Part 3”

As I mentioned previously, this site was put together using Pelican - a static site generator, written in Python.

Blueprint style diagram showing a brown Pelican
Figure 1. Pelecanus Occidentalis - the Brown Pelican. Original clipart Flying Pelican from OpenClipart, by molumen, Public Domain. More on Pelican, the bird.

Static site generators take your content, pour it into your templates and output the result as static pre-generated HTML, CSS, JS & image files. You can then just upload the resulting folder of output to your server and you’re done. All you need on the server is a web server of some sort, like Apache or Nginx - anything really - all it’s doing is serving static pages.

The huge advantage of this setup is simplicity:

  1. You can write your content in Markdown [1], reStructuredText [2] or AsciiDoc [3] - all simple text formats, designed to facilitate writing and get out of …
Continue reading “How I built this website, using Pelican: Part 1 - Setup”