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 injects articles published on the same month/day in previous years into the template context as on_this_day_articles.

Usage

Add to PLUGINS in pelicanconf.py:

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

Then use on_this_day_articles in your theme templates. Example (e.g. in a footer partial):

{% if on_this_day_articles %}
<aside id="on-this-day">
  <div class="inner">
    <p class="on-this-day-label">歷史上的今天</p>
    <div class="on-this-day-grid">
      {% for article in on_this_day_articles %}
        <a class="on-this-day-item" href="{{ SITEURL }}/{{ article.url }}">
          <section class="post-nav-teaser">
            <p class="post-nav-meta"><time datetime="{{ article.date.isoformat() }}">{{ article.date.strftime("%Y") }}</time></p>
            <h2 class="post-nav-title">{{ article.title|striptags|e }}</h2>
          </section>
        </a>
      {% endfor %}
    </div>
  </div>
</aside>
{% endif %}

The plugin automatically copies on-this-day.css to output/static/pelican_on_this_day/css/ and appends it to CSS_OVERRIDE (used by the Attila theme).

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.2.0.tar.gz (4.0 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.2.0-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pelican_on_this_day-0.2.0.tar.gz
  • Upload date:
  • Size: 4.0 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.2.0.tar.gz
Algorithm Hash digest
SHA256 796d626bfb5ddee2c613c9de448f7f6fbb1d573e2ee72e1c8dfafe1ae1d50dcd
MD5 ab9364c328bd9f1e8554f84d09af92de
BLAKE2b-256 770786f56f71f7690f036129cdfb5c9348f684b213f017982185e6d64f8e47b1

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pelican_on_this_day-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c925e0e14a1e6266b2d577ba05debc7e227b1d6a5f46913fe0ee3b55220ec11b
MD5 c8adeece4c7edaf7607c8fc953358b4b
BLAKE2b-256 db8ff69d6a97782e055a114f512d6b1b27560932c03e9f2420d689c805721bc8

See more details on using hashes here.

Provenance

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