Replace hard coded archive pages with layouts

This commit is contained in:
Michael Rose 2018-03-20 15:09:40 -04:00
parent 4cfbd7a5aa
commit cc81736778
12 changed files with 53 additions and 68 deletions

View file

@ -1,16 +0,0 @@
---
layout: archive
permalink: /categories/
title: "Posts by Category"
author_profile: true
---
{% include group-by-array collection=site.posts field="categories" %}
{% for category in group_names %}
{% assign posts = group_items[forloop.index0] %}
<h2 id="{{ category | slugify }}" class="archive__subtitle">{{ category }}</h2>
{% for post in posts %}
{% include archive-single.html %}
{% endfor %}
{% endfor %}

View file

@ -0,0 +1,6 @@
---
title: "Posts by Category"
layout: categories
permalink: /categories-archive/
author_profile: true
---

8
docs/_pages/edge-case.md Normal file
View file

@ -0,0 +1,8 @@
---
title: Edge Case
layout: category
permalink: /categories/edge-case/
taxonomy: Edge Case
---
Sample post listing for the category `Edge Case`.

8
docs/_pages/markup.md Normal file
View file

@ -0,0 +1,8 @@
---
title: Markup
layout: tag
permalink: /tags/markup/
taxonomy: markup
---
Sample post listing for the tag `markup`.

View file

@ -1,12 +0,0 @@
---
layout: archive
title: "Portfolio"
permalink: /portfolio/
author_profile: false
---
<div class="grid__wrapper">
{% for post in site.portfolio %}
{% include archive-single.html type="grid" %}
{% endfor %}
</div>

View file

@ -0,0 +1,10 @@
---
title: Portfolio
layout: collection
permalink: /portfolio/
collection: portfolio
entries_layout: grid
classes: wide
---
Sample document listing for the collection `_portfolio`.

View file

@ -1,10 +0,0 @@
---
layout: archive
title: "Recipes"
permalink: /recipes/
author_profile: false
---
{% for post in site.recipes %}
{% include archive-single.html %}
{% endfor %}

View file

@ -0,0 +1,9 @@
---
layout: collection
title: "Recipes"
collection: recipes
permalink: /recipes-archive/
author_profile: false
---
Sample document listing for the collection `_recipes`.

View file

@ -1,16 +0,0 @@
---
layout: archive
permalink: /tags/
title: "Posts by Tag"
author_profile: true
---
{% include group-by-array collection=site.posts field="tags" %}
{% for tag in group_names %}
{% assign posts = group_items[forloop.index0] %}
<h2 id="{{ tag | slugify }}" class="archive__subtitle">{{ tag }}</h2>
{% for post in posts %}
{% include archive-single.html %}
{% endfor %}
{% endfor %}

View file

@ -0,0 +1,6 @@
---
title: "Posts by Tag"
permalink: /tags-archive/
layout: tags
author_profile: true
---

View file

@ -1,14 +0,0 @@
---
layout: archive
permalink: /year-archive/
title: "Posts by Year"
author_profile: true
---
{% assign postsByYear = site.posts | group_by_exp:"post", "post.date | date: '%Y'" %}
{% for year in postsByYear %}
<h2 id="{{ year.name | slugify }}" class="archive__subtitle">{{ year.name }}</h2>
{% for post in year.items %}
{% include archive-single.html %}
{% endfor %}
{% endfor %}

View file

@ -0,0 +1,6 @@
---
title: "Posts by Year"
permalink: /year-archive/
layout: posts
author_profile: true
---