forked from getpelican/pelican-themes
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request getpelican#533 from josch/archive-sidebar
pelican-bootstrap3: Add archive to sidebar
- Loading branch information
Showing
3 changed files
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
pelican-bootstrap3/templates/includes/sidebar/archive.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 %} |