Replace hard coded archive pages with layouts
This commit is contained in:
parent
4cfbd7a5aa
commit
cc81736778
12 changed files with 53 additions and 68 deletions
|
@ -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 %}
|
|
6
docs/_pages/category-archive.md
Normal file
6
docs/_pages/category-archive.md
Normal 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
8
docs/_pages/edge-case.md
Normal 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
8
docs/_pages/markup.md
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
---
|
||||||
|
title: Markup
|
||||||
|
layout: tag
|
||||||
|
permalink: /tags/markup/
|
||||||
|
taxonomy: markup
|
||||||
|
---
|
||||||
|
|
||||||
|
Sample post listing for the tag `markup`.
|
|
@ -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>
|
|
10
docs/_pages/portfolio-archive.md
Normal file
10
docs/_pages/portfolio-archive.md
Normal 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`.
|
|
@ -1,10 +0,0 @@
|
||||||
---
|
|
||||||
layout: archive
|
|
||||||
title: "Recipes"
|
|
||||||
permalink: /recipes/
|
|
||||||
author_profile: false
|
|
||||||
---
|
|
||||||
|
|
||||||
{% for post in site.recipes %}
|
|
||||||
{% include archive-single.html %}
|
|
||||||
{% endfor %}
|
|
9
docs/_pages/recipes-archive.md
Normal file
9
docs/_pages/recipes-archive.md
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
---
|
||||||
|
layout: collection
|
||||||
|
title: "Recipes"
|
||||||
|
collection: recipes
|
||||||
|
permalink: /recipes-archive/
|
||||||
|
author_profile: false
|
||||||
|
---
|
||||||
|
|
||||||
|
Sample document listing for the collection `_recipes`.
|
|
@ -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 %}
|
|
6
docs/_pages/tag-archive.md
Normal file
6
docs/_pages/tag-archive.md
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
---
|
||||||
|
title: "Posts by Tag"
|
||||||
|
permalink: /tags-archive/
|
||||||
|
layout: tags
|
||||||
|
author_profile: true
|
||||||
|
---
|
|
@ -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 %}
|
|
6
docs/_pages/year-archive.md
Normal file
6
docs/_pages/year-archive.md
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
---
|
||||||
|
title: "Posts by Year"
|
||||||
|
permalink: /year-archive/
|
||||||
|
layout: posts
|
||||||
|
author_profile: true
|
||||||
|
---
|
Loading…
Reference in a new issue