From ed7149e2bf393a1f3585d216316c17d8331d61fd Mon Sep 17 00:00:00 2001 From: Matthew Grove Date: Mon, 9 Mar 2020 12:41:55 +0000 Subject: [PATCH] Remove redundant code --- _config.yml | 3 +-- _includes/navbar.html | 8 ++++---- _layouts/year.html | 2 +- index.md | 4 ++-- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/_config.yml b/_config.yml index d4f3fcd..9df08d6 100644 --- a/_config.yml +++ b/_config.yml @@ -13,5 +13,4 @@ defaults: path: "" type: "posts" values: - layout: "image-article" - categories: articles \ No newline at end of file + layout: "image-article" \ No newline at end of file diff --git a/_includes/navbar.html b/_includes/navbar.html index ac7cb56..45c19fc 100644 --- a/_includes/navbar.html +++ b/_includes/navbar.html @@ -13,13 +13,13 @@ Home Page - {% if site.categories.articles %} + {% if site.posts %}

Articles

- {% for article in site.categories.articles %} + {% for article in site.posts %} {% assign currentdate = article.date | date: "%Y" %} {% if currentdate != date %} - {% if article.url != site.categories.articles.first.url %} + {% if article.url != site.posts.first.url %}
{% endif %}
@@ -34,7 +34,7 @@ {{ article.title }} - {% if article.url == site.categories.articles.last.url %} + {% if article.url == site.posts.last.url %}
{% endif %} {% endfor %} diff --git a/_layouts/year.html b/_layouts/year.html index 3b9385a..fc3d273 100644 --- a/_layouts/year.html +++ b/_layouts/year.html @@ -26,7 +26,7 @@
- {% assign articles = site.categories.articles | sort: date | reverse %} + {% assign articles = site.posts | sort: date | reverse %} {% for article in articles %} {% assign articleyear = article.date | date: "%Y" %} {% if pageyear == articleyear %} diff --git a/index.md b/index.md index ef22d79..1ae1d56 100644 --- a/index.md +++ b/index.md @@ -4,9 +4,9 @@ description: News articles written by Reading School students in year 8 layout: home --- -{% if site.categories.articles %} +{% if site.posts %} {% assign currentdate_count = 0 %} -{% assign articles = site.categories.articles | sort: date | reverse %} +{% assign articles = site.posts | sort: date | reverse %} {% for article in articles %} {% assign currentdate = article.date | date: "%Y" %} {% if currentdate != date %}