on-this-day.js

Last updated:

A small JavaScript helper that shows posts from your weblog.lol site that were published on this same date in previous years.

How it works

  1. Fetches your site’s /archive page
  2. Finds posts that match today’s month and day in earlier years
  3. Shows them right away, newest first, each with its date
  4. Fills in each full post as it loads, 4 at a time so a busy day doesn’t hammer the server
  5. Links to a post if it won’t load, and says so when there are no posts for today

This assumes you’re using the standard weblog.lol archive structure.

Quick setup

Create a new page on your weblog.lol site and paste the following:

<div id="on-this-day">
Loading...
</div>

<script src="https://scripts.brebs.net/on-this-day/on-this-day.js"></script>

Save the page. That’s it.

Requirements

Get the script

You can use the hosted version directly:

<script src="https://scripts.brebs.net/on-this-day/on-this-day.js"></script>

Self-hosting (if you like doing that)

If you prefer to host the script yourself, you can copy the source and host it anywhere that serves raw JavaScript.

One easy option is use omg.lol amazing service of paste.lol.

  1. Copy or download the code of on-this-day.js
  2. Create a new paste at paste.lol
  3. Name it something like on-this-day.js
  4. Use the /raw version of the paste as your script source
<script src="https://ericmwalk.paste.lol/on-this-day.js/raw"></script>