mirror of
https://github.com/mgrove36/bbc-young-reporter.git
synced 2026-03-03 03:17:07 +00:00
Remove redundant code
This commit is contained in:
@@ -13,5 +13,4 @@ defaults:
|
|||||||
path: ""
|
path: ""
|
||||||
type: "posts"
|
type: "posts"
|
||||||
values:
|
values:
|
||||||
layout: "image-article"
|
layout: "image-article"
|
||||||
categories: articles
|
|
||||||
@@ -13,13 +13,13 @@
|
|||||||
<i class="material-icons mdc-list-item__graphic" aria-hidden="true">home</i>
|
<i class="material-icons mdc-list-item__graphic" aria-hidden="true">home</i>
|
||||||
<span class="mdc-list-item__text">Home Page</span>
|
<span class="mdc-list-item__text">Home Page</span>
|
||||||
</a>
|
</a>
|
||||||
{% if site.categories.articles %}
|
{% if site.posts %}
|
||||||
<div class="mdc-list-group">
|
<div class="mdc-list-group">
|
||||||
<h3 class="mdc-typography--headline7">Articles</h3>
|
<h3 class="mdc-typography--headline7">Articles</h3>
|
||||||
{% for article in site.categories.articles %}
|
{% for article in site.posts %}
|
||||||
{% assign currentdate = article.date | date: "%Y" %}
|
{% assign currentdate = article.date | date: "%Y" %}
|
||||||
{% if currentdate != date %}
|
{% if currentdate != date %}
|
||||||
{% if article.url != site.categories.articles.first.url %}
|
{% if article.url != site.posts.first.url %}
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<div class="mdc-list-group">
|
<div class="mdc-list-group">
|
||||||
@@ -34,7 +34,7 @@
|
|||||||
<i class="material-icons mdc-list-item__graphic" aria-hidden="true">assignment</i>
|
<i class="material-icons mdc-list-item__graphic" aria-hidden="true">assignment</i>
|
||||||
<span class="mdc-list-item__text">{{ article.title }}</span>
|
<span class="mdc-list-item__text">{{ article.title }}</span>
|
||||||
</a>
|
</a>
|
||||||
{% if article.url == site.categories.articles.last.url %}
|
{% if article.url == site.posts.last.url %}
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
<div class="splitter"></div>
|
<div class="splitter"></div>
|
||||||
<div class="article-section">
|
<div class="article-section">
|
||||||
<div class="articles">
|
<div class="articles">
|
||||||
{% assign articles = site.categories.articles | sort: date | reverse %}
|
{% assign articles = site.posts | sort: date | reverse %}
|
||||||
{% for article in articles %}
|
{% for article in articles %}
|
||||||
{% assign articleyear = article.date | date: "%Y" %}
|
{% assign articleyear = article.date | date: "%Y" %}
|
||||||
{% if pageyear == articleyear %}
|
{% if pageyear == articleyear %}
|
||||||
|
|||||||
4
index.md
4
index.md
@@ -4,9 +4,9 @@ description: News articles written by Reading School students in year 8
|
|||||||
layout: home
|
layout: home
|
||||||
---
|
---
|
||||||
|
|
||||||
{% if site.categories.articles %}
|
{% if site.posts %}
|
||||||
{% assign currentdate_count = 0 %}
|
{% assign currentdate_count = 0 %}
|
||||||
{% assign articles = site.categories.articles | sort: date | reverse %}
|
{% assign articles = site.posts | sort: date | reverse %}
|
||||||
{% for article in articles %}
|
{% for article in articles %}
|
||||||
{% assign currentdate = article.date | date: "%Y" %}
|
{% assign currentdate = article.date | date: "%Y" %}
|
||||||
{% if currentdate != date %}
|
{% if currentdate != date %}
|
||||||
|
|||||||
Reference in New Issue
Block a user