Skip to main content

Pelican plugin to surface articles published on the same month/day in previous years.

Project description

pelican-on-this-day

Pelican plugin that shows articles published on the same month/day in previous years — an "On This Day" section.

The section is rendered client-side: at build time the plugin writes a JSON map of "MM-DD" → articles to the output, and the bundled JS picks the visitor's local date at page load. The section therefore stays correct on a static host without daily rebuilds, and articles from the visitor's current year are excluded.

Usage

Add to PLUGINS in pelicanconf.py:

PLUGINS = [
    ...
    "pelican.plugins.on_this_day",
]

That's it for the Attila theme — the plugin overrides the footer partial with a placeholder and wires everything up:

<aside id="on-this-day" hidden data-source="{{ SITEURL }}/static/pelican_on_this_day/on-this-day.json">
  <div class="inner">
    <p class="on-this-day-label">{% trans %}On This Day{% endtrans %}</p>
    <div class="on-this-day-grid"></div>
  </div>
</aside>
<script src="{{ SITEURL }}/static/pelican_on_this_day/js/on-this-day.js" defer></script>

For other themes, include the same placeholder markup anywhere in your templates; the JS fills .on-this-day-grid and removes hidden when there are matching articles. The section stays hidden when there is nothing to show (or when the data file can't be fetched).

What gets emitted

  • output/static/pelican_on_this_day/on-this-day.json{"MM-DD": [{"year", "date", "title", "url"}, ...], ...}, newest first, URLs prefixed with SITEURL
  • output/static/pelican_on_this_day/js/on-this-day.js — client-side renderer
  • output/static/pelican_on_this_day/css/on-this-day.css — appended to CSS_OVERRIDE automatically

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pelican_on_this_day-0.3.0.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pelican_on_this_day-0.3.0-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file pelican_on_this_day-0.3.0.tar.gz.

File metadata

  • Download URL: pelican_on_this_day-0.3.0.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pelican_on_this_day-0.3.0.tar.gz
Algorithm Hash digest
SHA256 9e3319170242ace94bb134c74f3cc24de9a26621db35f5aeeef16ae4e6036c52
MD5 c85d589a7984304de4a6828f5b00bda6
BLAKE2b-256 711f60e1da1b91fec7767b81c8b410a9e79f849a5939ad94e416e3ea486d8999

See more details on using hashes here.

Provenance

The following attestation bundles were made for pelican_on_this_day-0.3.0.tar.gz:

Publisher: publish-to-pypi.yaml on Lee-W/pelican-on-this-day

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pelican_on_this_day-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pelican_on_this_day-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 27dfde8859317d8344c15af9bf8cfad485fe193887a1558e4d43c00b9f985ec4
MD5 e625feeb8c68837dc657c44008b74d5c
BLAKE2b-256 fffe60d19c99fa19c42b0717741fda7ef9f92d0f2db8ff2439d4004e499a4422

See more details on using hashes here.

Provenance

The following attestation bundles were made for pelican_on_this_day-0.3.0-py3-none-any.whl:

Publisher: publish-to-pypi.yaml on Lee-W/pelican-on-this-day

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page