aboutsummaryrefslogtreecommitdiffstats
path: root/pelican-bootstrap3/templates
diff options
context:
space:
mode:
authorJustin Mayer <entroP@gmail.com>2017-09-04 11:08:43 -0700
committerGitHub <noreply@github.com>2017-09-04 11:08:43 -0700
commit65acef24bed0770e43f80a2c9b64ede46e4e6a17 (patch)
treea8ffa94d664e4dfc050e6087341fc2f7518418ed /pelican-bootstrap3/templates
parentdcecbb6085f24420b14d97f06c53f49755db95c9 (diff)
parente315b00368413ea786712aa90ae3e84d4dacdafc (diff)
downloadpelican-themes-65acef24bed0770e43f80a2c9b64ede46e4e6a17.tar.gz
Merge pull request #533 from josch/archive-sidebar
pelican-bootstrap3: Add archive to sidebar
Diffstat (limited to 'pelican-bootstrap3/templates')
-rw-r--r--pelican-bootstrap3/templates/includes/sidebar.html1
-rw-r--r--pelican-bootstrap3/templates/includes/sidebar/archive.html23
2 files changed, 24 insertions, 0 deletions
diff --git a/pelican-bootstrap3/templates/includes/sidebar.html b/pelican-bootstrap3/templates/includes/sidebar.html
index d83a7b8..71bab3a 100644
--- a/pelican-bootstrap3/templates/includes/sidebar.html
+++ b/pelican-bootstrap3/templates/includes/sidebar.html
@@ -12,6 +12,7 @@
{% include 'includes/sidebar/links.html' %}
{% include 'includes/sidebar/authors.html' %}
{% include 'includes/sidebar/images.html' %}
+ {% include 'includes/sidebar/archive.html' %}
{% include 'includes/sidebar/optional_bottom.html' ignore missing %}
</ul>
</section>
diff --git a/pelican-bootstrap3/templates/includes/sidebar/archive.html b/pelican-bootstrap3/templates/includes/sidebar/archive.html
new file mode 100644
index 0000000..881897b
--- /dev/null
+++ b/pelican-bootstrap3/templates/includes/sidebar/archive.html
@@ -0,0 +1,23 @@
+{% if DISPLAY_ARCHIVE_ON_SIDEBAR and MONTH_ARCHIVE_SAVE_AS %}
+ {% from 'includes/sidebar/macros.jinja' import title %}
+
+<!-- Sidebar/Archive -->
+<li class="list-group-item">
+ <h4>{{ title(_('Archive'), DISABLE_SIDEBAR_TITLE_ICONS) }}</h4>
+ <ul class="list-group" id="archive">
+ {% for year, date_year in dates|groupby( 'date.year' )|sort(reverse=True) %}
+ {% for month, articles in date_year|groupby( 'date.month' )|sort(reverse=True) %}
+ <li class="list-group-item">
+ <a href="{{ SITEURL }}/{{ MONTH_ARCHIVE_SAVE_AS.format(date=articles[0].date) }}">
+ {%- if not DISABLE_SIDEBAR_TITLE_ICONS -%}
+ <i class="fa fa-calendar fa-lg"></i>
+ {%- endif -%}
+ {{ articles[0].date.strftime('%B') }} {{ year }} ({{ articles|count }})
+ </a>
+ </li>
+ {% endfor %}
+ {% endfor %}
+ </ul>
+</li>
+<!-- End Sidebar/Archive -->
+{% endif %}