mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Add period to period_archives context. Refs #1044.
* Adds period tuple of (year, month, day) matching the time period of the current archive. Note that this is done to the archive context if period_archives.html doesn't exist. * Adds tests to verify this. * Adds documentation in themes.rst about period in period_archives.html.
This commit is contained in:
parent
f232958daf
commit
f6e27617f8
5 changed files with 133 additions and 13 deletions
13
pelican/themes/notmyidea/templates/period_archives.html
Normal file
13
pelican/themes/notmyidea/templates/period_archives.html
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
<section id="content" class="body">
|
||||
<h1>Archives for {{ period | reverse | join(' ') }}</h1>
|
||||
|
||||
<dl>
|
||||
{% for article in dates %}
|
||||
<dt>{{ article.locale_date }}</dt>
|
||||
<dd><a href="{{ SITEURL }}/{{ article.url }}">{{ article.title }}</a></dd>
|
||||
{% endfor %}
|
||||
</dl>
|
||||
</section>
|
||||
{% endblock %}
|
||||
11
pelican/themes/simple/templates/period_archives.html
Normal file
11
pelican/themes/simple/templates/period_archives.html
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
<h1>Archives for {{ period | reverse | join(' ') }}</h1>
|
||||
|
||||
<dl>
|
||||
{% for article in dates %}
|
||||
<dt>{{ article.locale_date }}</dt>
|
||||
<dd><a href="{{ SITEURL }}/{{ article.url }}">{{ article.title }}</a></dd>
|
||||
{% endfor %}
|
||||
</dl>
|
||||
{% endblock %}
|
||||
Loading…
Add table
Add a link
Reference in a new issue