mirror of
https://github.com/mgrove36/bbc-young-reporter.git
synced 2026-03-03 03:17:07 +00:00
Add list group for each year of articles on the navbar
This commit is contained in:
@@ -14,17 +14,26 @@
|
||||
</a>
|
||||
{% if site.categories.articles %}
|
||||
<div class="mdc-list-group">
|
||||
<h3 class="mdc-list-group__subheader">Articles</h3>
|
||||
<h3 class="mdc-typography--headline7">Articles</h3>
|
||||
{% for article in site.categories.articles %}
|
||||
{% assign currentdate = article.date | date: "%Y" %}
|
||||
{% if currentdate != date %}
|
||||
{% if article.url != site.categories.articles.first.url %}
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="mdc-list-group">
|
||||
<h3 class="mdc-list-group__subheader">{{ currentdate }}</h3>
|
||||
{% assign date = currentdate %}
|
||||
{% endif %}
|
||||
<a class="mdc-list-item" href="{{ page.url | relative_url }}" data-mdc-auto-init="MDCRipple">
|
||||
<a class="mdc-list-item" href="{{ article.url | relative_url }}" data-mdc-auto-init="MDCRipple">
|
||||
<i class="material-icons mdc-list-item__graphic" aria-hidden="true">assignment</i>
|
||||
<span class="mdc-list-item__text">{{ article.title }}</span>
|
||||
</a>
|
||||
{% if currentdate != date %}
|
||||
{% endif %}
|
||||
{% if article.url == site.categories.articles.last.url %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
Reference in New Issue
Block a user