-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename template files for categories
- Loading branch information
Showing
3 changed files
with
36 additions
and
37 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,21 @@ | ||
--- | ||
pagination: | ||
data: collections.categories | ||
size: 1 | ||
alias: category | ||
permalink: /blog/categories/{{ category | slugify }}/ | ||
layout: global/content | ||
eleventyComputed: | ||
title: 'Blog Post Category: "{{ category }}"' | ||
eleventyNavigation: | ||
key: {{ category }} | ||
parent: Categories | ||
title: Blog Post Categories | ||
tags: blog pages | ||
blogNav: Categories | ||
eleventyNavigation: | ||
key: Blog Categories | ||
title: Categories | ||
parent: Blog | ||
order: 2 | ||
--- | ||
{% set postCount = collections.posts | filterByCategory(category) | length %} | ||
<h2>{{ postCount }} Posts Filed Under "{{ category }}"</h2> | ||
|
||
{% set postList = collections.posts | filterByCategory(category) | reverse %} | ||
{% include "blog/postslist.njk" %} | ||
<ul> | ||
{% for category in collections.categories %} | ||
{% set categoryUrl %}/blog/categories/{{ category | slugify }}/{% endset %} | ||
{% set categoryPostCount = collections.posts | filterByCategory(category) | length %} | ||
<li><a href="{{ categoryUrl }}">{{ category }}</a> ({{ categoryPostCount }} posts)</li> | ||
{% endfor %} | ||
</ul> | ||
|
||
<p>See <a href="/blog/categories/">all blog post categories</a>.</p> | ||
<p>See all blog posts in the <a href="/blog/posts/">archive</a>.</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
pagination: | ||
data: collections.categories | ||
size: 1 | ||
alias: category | ||
permalink: /blog/categories/{{ category | slugify }}/ | ||
layout: global/content | ||
eleventyComputed: | ||
title: 'Blog Post Category: "{{ category }}"' | ||
eleventyNavigation: | ||
key: {{ category }} | ||
parent: Categories | ||
--- | ||
{% set postCount = collections.posts | filterByCategory(category) | length %} | ||
<h2>{{ postCount }} Posts Filed Under "{{ category }}"</h2> | ||
|
||
{% set postList = collections.posts | filterByCategory(category) | reverse %} | ||
{% include "blog/postslist.njk" %} | ||
|
||
<p>See <a href="/blog/categories/">all blog post categories</a>.</p> |