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 (needs the version providing the partials/footer_extra.html hook) — the plugin overrides that hook 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.4.0.tar.gz (4.8 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.4.0-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pelican_on_this_day-0.4.0.tar.gz
  • Upload date:
  • Size: 4.8 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.4.0.tar.gz
Algorithm Hash digest
SHA256 1d7d6faa2bc64e1be3a6207a8e28f7f6a76685c62c9c744bcfdeb87e6d2818c9
MD5 f5880c370d6646185e54bdc69d51db4a
BLAKE2b-256 362927e9e1703751f40b828d85d6373b4c972bd6ae54a33bc1c29fac0df5aafc

See more details on using hashes here.

Provenance

The following attestation bundles were made for pelican_on_this_day-0.4.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.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pelican_on_this_day-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e666ed6449d035357d1a3b8d0e9187e63ad00da185f0dcfe6e1910c42a42052f
MD5 d60e282b0607b2fec32fd2d598bdb1ca
BLAKE2b-256 4c30a43a78a392e589fcd89ad2788e17d1d6e85c16e2d39dadbe8bbd1a45b92a

See more details on using hashes here.

Provenance

The following attestation bundles were made for pelican_on_this_day-0.4.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