on-this-day.js
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
- Fetches your site’s
/archivepage - Finds posts that match today’s month and day in earlier years
- Shows them right away, newest first, each with its date
- Fills in each full post as it loads, 4 at a time so a busy day doesn’t hammer the server
- 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
- A public
/archivepage - Standard weblog.lol archive markup
- Posts with valid publish dates
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.
- Copy or download the code of
on-this-day.js - Create a new paste at
paste.lol - Name it something like
on-this-day.js - Use the
/rawversion of the paste as your script source
<script src="https://ericmwalk.paste.lol/on-this-day.js/raw"></script>