diff --git a/src/assets/styles/partials/_blog-item.scss b/src/assets/styles/partials/_blog-item.scss
new file mode 100644
index 0000000..f1eea6e
--- /dev/null
+++ b/src/assets/styles/partials/_blog-item.scss
@@ -0,0 +1,19 @@
+.blog-item {
+ margin-bottom: calc(var(--unit) * 3);
+
+ .tags {
+ display: flex;
+ margin: var(--unit) 0;
+
+ ul {
+ list-style-type: none;
+ display: flex;
+ margin: 0;
+ padding: 0;
+ }
+
+ li {
+ padding: 0 var(--unit);
+ }
+ }
+}
diff --git a/src/assets/styles/partials/_pagination.scss b/src/assets/styles/partials/_pagination.scss
new file mode 100644
index 0000000..ebbb22e
--- /dev/null
+++ b/src/assets/styles/partials/_pagination.scss
@@ -0,0 +1,23 @@
+.pagination {
+ ol,
+ ul {
+ margin: 0;
+ padding: 0;
+ list-style-type: none;
+ display: flex;
+ }
+
+ li {
+ padding: 0 var(--unit);
+ }
+
+ .highlighted {
+ background: var(--color-light);
+ }
+
+ [aria-current="page"] {
+ text-decoration: none;
+ pointer-events: none;
+ color: var(--color-text);
+ }
+}
diff --git a/src/assets/styles/styles.scss b/src/assets/styles/styles.scss
index e242241..44ec016 100644
--- a/src/assets/styles/styles.scss
+++ b/src/assets/styles/styles.scss
@@ -4,6 +4,10 @@
@import "reset";
@import "branding";
+/** Partials **/
+@import "partials/pagination";
+@import "partials/blog-item";
+
/**
* ZeroPoint starter styling
*/
diff --git a/src/assets/views/partials/blog-item.njk b/src/assets/views/partials/blog-item.njk
new file mode 100644
index 0000000..320acd4
--- /dev/null
+++ b/src/assets/views/partials/blog-item.njk
@@ -0,0 +1,16 @@
+
+
+
+ {{ post.templateContent | safe }}
+
+
diff --git a/src/assets/views/partials/pagination.njk b/src/assets/views/partials/pagination.njk
new file mode 100644
index 0000000..0c58ecd
--- /dev/null
+++ b/src/assets/views/partials/pagination.njk
@@ -0,0 +1,103 @@
+
diff --git a/src/config/collections.js b/src/config/collections.js
index cf4a839..e84cbcf 100644
--- a/src/config/collections.js
+++ b/src/config/collections.js
@@ -2,16 +2,50 @@
* Add Eleventy collections here
* https://www.11ty.dev/docs/collections/
*/
+let _ = require("lodash");
module.exports = {
- // /**
- // * Blog posts
- // */
- // posts: function (eleventyConfig) {
- // eleventyConfig.addCollection("posts", function(collectionApi) {
- // return collectionApi.getFilteredByGlob("src/content/posts/*.md");
- // });
- // },
+ /**
+ * Blog posts
+ */
+ posts: function (eleventyConfig) {
+ eleventyConfig.addCollection("posts", function(collectionApi) {
+ return collectionApi.getFilteredByGlob("src/content/posts/*.md");
+ });
+ },
+
+
+ /**
+ * Blog posts, paginated and by tag
+ */
+ postsByTag: function (eleventyConfig) {
+ eleventyConfig.addCollection("postsByTag", function(collection) {
+
+ // Get unique list of all tags currently in use
+ const tagSet = new Set(collection.getAllSorted().flatMap((post) => post.data.tags || []));
+
+ // Get each item that matches the tag and add it to the tag's array, chunked by paginationSize
+ let paginationSize = 2;
+ let tagMap = [];
+ let tagArray = [...tagSet];
+ for(let tagName of tagArray) {
+
+ let tagItems = collection.getFilteredByTag(tagName).reverse();
+ let pagedItems = _.chunk(tagItems, paginationSize);
+ for( let pageNumber = 0, max = pagedItems.length; pageNumber < max; pageNumber++) {
+ tagMap.push({
+ slug: tagName,
+ totalPages: (max - 1),
+ pageNumber: pageNumber,
+ posts: pagedItems[pageNumber]
+ });
+ }
+ }
+
+ // Return a two-dimensional array of items, chunked by paginationSize
+ return tagMap;
+ });
+ },
/**
diff --git a/src/content/blog-tags.njk b/src/content/blog-tags.njk
new file mode 100644
index 0000000..9f9413e
--- /dev/null
+++ b/src/content/blog-tags.njk
@@ -0,0 +1,17 @@
+---
+layout: base.njk
+permalink: /blog/{{ tag.slug | slugify }}/{% if tag.pageNumber > 0 %}/page/{{ tag.pageNumber + 1 }}{% endif %}/index.html
+pagination:
+ data: collections.postsByTag
+ size: 1
+ alias: tag
+ addAllPagesToCollections: true
+eleventyComputed:
+ title: Blog entries with tag "{{ tag.slug }}" {% if tag.pageNumber > 0 %}, (Page {{ tag.pageNumber + 1 }}) {% endif %}
+---
+
+ {% for post in tag.posts %}
+ {% include "partials/blog-item.njk" %}
+ {% endfor %}
+ {% include "partials/pagination.njk" %}
+
diff --git a/src/content/blog.njk b/src/content/blog.njk
new file mode 100644
index 0000000..97b0c16
--- /dev/null
+++ b/src/content/blog.njk
@@ -0,0 +1,17 @@
+---
+layout: base.njk
+permalink: /blog/{% if pagination.pageNumber > 0 %}/page/{{ pagination.pageNumber + 1 }}{% endif %}/index.html
+pagination:
+ data: collections.posts
+ size: 10
+ alias: posts
+ reverse: true
+eleventyComputed:
+ title: Blog {% if pagination.pageNumber > 0 %}(Page {{ pagination.pageNumber + 1 }}) {% endif %}
+---
+
+ {% for post in posts %}
+ {% include "partials/blog-item.njk" %}
+ {% endfor %}
+ {% include "partials/pagination.njk" %}
+
diff --git a/src/content/posts/color-blue.md b/src/content/posts/color-blue.md
new file mode 100644
index 0000000..0b78721
--- /dev/null
+++ b/src/content/posts/color-blue.md
@@ -0,0 +1,6 @@
+---
+title: Blue
+tags:
+ - color
+---
+Tempor commodo occaecat minim laboris tempor. Eiusmod et ea aliquip irure deserunt veniam irure culpa commodo esse. Fugiat dolor mollit commodo fugiat dolor quis irure nulla magna minim. Consectetur culpa velit aliqua voluptate qui commodo labore elit. Consequat ullamco veniam officia enim laborum consectetur irure dolor ut. Elit eiusmod in ipsum tempor labore nulla amet nostrud id.
diff --git a/src/content/posts/color-burnt-sienna.md b/src/content/posts/color-burnt-sienna.md
new file mode 100644
index 0000000..c339d66
--- /dev/null
+++ b/src/content/posts/color-burnt-sienna.md
@@ -0,0 +1,6 @@
+---
+title: Burnt Sienna
+tags:
+ - color
+---
+Tempor commodo occaecat minim laboris tempor. Eiusmod et ea aliquip irure deserunt veniam irure culpa commodo esse. Fugiat dolor mollit commodo fugiat dolor quis irure nulla magna minim. Consectetur culpa velit aliqua voluptate qui commodo labore elit. Consequat ullamco veniam officia enim laborum consectetur irure dolor ut. Elit eiusmod in ipsum tempor labore nulla amet nostrud id.
diff --git a/src/content/posts/color-mute-puce.md b/src/content/posts/color-mute-puce.md
new file mode 100644
index 0000000..3cee898
--- /dev/null
+++ b/src/content/posts/color-mute-puce.md
@@ -0,0 +1,6 @@
+---
+title: Mute Puce
+tags:
+ - color
+---
+Tempor commodo occaecat minim laboris tempor. Eiusmod et ea aliquip irure deserunt veniam irure culpa commodo esse. Fugiat dolor mollit commodo fugiat dolor quis irure nulla magna minim. Consectetur culpa velit aliqua voluptate qui commodo labore elit. Consequat ullamco veniam officia enim laborum consectetur irure dolor ut. Elit eiusmod in ipsum tempor labore nulla amet nostrud id.
diff --git a/src/content/posts/color-purple.md b/src/content/posts/color-purple.md
new file mode 100644
index 0000000..f075e9f
--- /dev/null
+++ b/src/content/posts/color-purple.md
@@ -0,0 +1,6 @@
+---
+title: Purple
+tags:
+ - color
+---
+Tempor commodo occaecat minim laboris tempor. Eiusmod et ea aliquip irure deserunt veniam irure culpa commodo esse. Fugiat dolor mollit commodo fugiat dolor quis irure nulla magna minim. Consectetur culpa velit aliqua voluptate qui commodo labore elit. Consequat ullamco veniam officia enim laborum consectetur irure dolor ut. Elit eiusmod in ipsum tempor labore nulla amet nostrud id.
diff --git a/src/content/posts/color-red.md b/src/content/posts/color-red.md
new file mode 100644
index 0000000..273eeb3
--- /dev/null
+++ b/src/content/posts/color-red.md
@@ -0,0 +1,6 @@
+---
+title: Red
+tags:
+ - color
+---
+Tempor commodo occaecat minim laboris tempor. Eiusmod et ea aliquip irure deserunt veniam irure culpa commodo esse. Fugiat dolor mollit commodo fugiat dolor quis irure nulla magna minim. Consectetur culpa velit aliqua voluptate qui commodo labore elit. Consequat ullamco veniam officia enim laborum consectetur irure dolor ut. Elit eiusmod in ipsum tempor labore nulla amet nostrud id.
diff --git a/src/content/posts/recipe-boiled-water.md b/src/content/posts/recipe-boiled-water.md
new file mode 100644
index 0000000..ab91c65
--- /dev/null
+++ b/src/content/posts/recipe-boiled-water.md
@@ -0,0 +1,6 @@
+---
+title: Boiled Water
+tags:
+ - recipe
+---
+Tempor commodo occaecat minim laboris tempor. Eiusmod et ea aliquip irure deserunt veniam irure culpa commodo esse. Fugiat dolor mollit commodo fugiat dolor quis irure nulla magna minim. Consectetur culpa velit aliqua voluptate qui commodo labore elit. Consequat ullamco veniam officia enim laborum consectetur irure dolor ut. Elit eiusmod in ipsum tempor labore nulla amet nostrud id.
diff --git a/src/content/posts/recipe-coca-cola-secret.md b/src/content/posts/recipe-coca-cola-secret.md
new file mode 100644
index 0000000..91d97cf
--- /dev/null
+++ b/src/content/posts/recipe-coca-cola-secret.md
@@ -0,0 +1,6 @@
+---
+title: Coca Cola (Secret)
+tags:
+ - recipe
+---
+Tempor commodo occaecat minim laboris tempor. Eiusmod et ea aliquip irure deserunt veniam irure culpa commodo esse. Fugiat dolor mollit commodo fugiat dolor quis irure nulla magna minim. Consectetur culpa velit aliqua voluptate qui commodo labore elit. Consequat ullamco veniam officia enim laborum consectetur irure dolor ut. Elit eiusmod in ipsum tempor labore nulla amet nostrud id.
diff --git a/src/content/posts/recipe-color-red-velvet-cake.md b/src/content/posts/recipe-color-red-velvet-cake.md
new file mode 100644
index 0000000..ca770e8
--- /dev/null
+++ b/src/content/posts/recipe-color-red-velvet-cake.md
@@ -0,0 +1,7 @@
+---
+title: Red Velvet Cake
+tags:
+ - recipe
+ - color
+---
+Tempor commodo occaecat minim laboris tempor. Eiusmod et ea aliquip irure deserunt veniam irure culpa commodo esse. Fugiat dolor mollit commodo fugiat dolor quis irure nulla magna minim. Consectetur culpa velit aliqua voluptate qui commodo labore elit. Consequat ullamco veniam officia enim laborum consectetur irure dolor ut. Elit eiusmod in ipsum tempor labore nulla amet nostrud id.
diff --git a/src/content/posts/recipe-pan-galactic-gargleblaster.md b/src/content/posts/recipe-pan-galactic-gargleblaster.md
new file mode 100644
index 0000000..629e721
--- /dev/null
+++ b/src/content/posts/recipe-pan-galactic-gargleblaster.md
@@ -0,0 +1,6 @@
+---
+title: Pan Galactic Gargleblaster
+tags:
+ - recipe
+---
+Tempor commodo occaecat minim laboris tempor. Eiusmod et ea aliquip irure deserunt veniam irure culpa commodo esse. Fugiat dolor mollit commodo fugiat dolor quis irure nulla magna minim. Consectetur culpa velit aliqua voluptate qui commodo labore elit. Consequat ullamco veniam officia enim laborum consectetur irure dolor ut. Elit eiusmod in ipsum tempor labore nulla amet nostrud id.
diff --git a/src/content/posts/recipe-peanut-butter-sandwitch.md b/src/content/posts/recipe-peanut-butter-sandwitch.md
new file mode 100644
index 0000000..c29078c
--- /dev/null
+++ b/src/content/posts/recipe-peanut-butter-sandwitch.md
@@ -0,0 +1,6 @@
+---
+title: Peanut Butter Sandwich
+tags:
+ - recipe
+---
+Tempor commodo occaecat minim laboris tempor. Eiusmod et ea aliquip irure deserunt veniam irure culpa commodo esse. Fugiat dolor mollit commodo fugiat dolor quis irure nulla magna minim. Consectetur culpa velit aliqua voluptate qui commodo labore elit. Consequat ullamco veniam officia enim laborum consectetur irure dolor ut. Elit eiusmod in ipsum tempor labore nulla amet nostrud id.
diff --git a/src/content/posts/recipe-the-blood-of-your-enemies.md b/src/content/posts/recipe-the-blood-of-your-enemies.md
new file mode 100644
index 0000000..002fd6f
--- /dev/null
+++ b/src/content/posts/recipe-the-blood-of-your-enemies.md
@@ -0,0 +1,7 @@
+---
+title: The Blood of Your Enemies
+tags:
+ - recipe
+ - color
+---
+Tempor commodo occaecat minim laboris tempor. Eiusmod et ea aliquip irure deserunt veniam irure culpa commodo esse. Fugiat dolor mollit commodo fugiat dolor quis irure nulla magna minim. Consectetur culpa velit aliqua voluptate qui commodo labore elit. Consequat ullamco veniam officia enim laborum consectetur irure dolor ut. Elit eiusmod in ipsum tempor labore nulla amet nostrud id.
diff --git a/src/data/navigation.json b/src/data/navigation.json
index ae5f9c9..9022b43 100644
--- a/src/data/navigation.json
+++ b/src/data/navigation.json
@@ -9,6 +9,11 @@
"text": "Contact",
"url": "/contact/",
"external": false
+ },
+ {
+ "text": "Blog",
+ "url": "/blog/",
+ "external": false
}
]
}