From 7beac40ecddf426b9e4b59143fed251f56ccbff8 Mon Sep 17 00:00:00 2001 From: Chris Kaczor Date: Mon, 14 Oct 2024 15:19:20 +0000 Subject: [PATCH] Add more customization --- _data/metadata.js | 12 ++++++------ _includes/layouts/home.njk | 11 ----------- eleventy.config.js | 25 +++++++++++++++++++++---- 3 files changed, 27 insertions(+), 21 deletions(-) diff --git a/_data/metadata.js b/_data/metadata.js index 7e8b636..4e20e6a 100644 --- a/_data/metadata.js +++ b/_data/metadata.js @@ -1,11 +1,11 @@ export default { - title: "Eleventy Base Blog v9", - url: "https://example.com/", + title: "Chris Kaczor", + url: "https://chriskaczor.com/", language: "en", - description: "I am writing about my experiences as a naval navel-gazer.", + description: "Code, Critters, and whatever I feel like writing about.", author: { - name: "Your Name Here", - email: "youremailaddress@example.com", - url: "https://example.com/about-me/" + name: "Chris Kaczor", + email: "chris@kaczor.us", + url: "https://chriskaczor.com/about/" } } diff --git a/_includes/layouts/home.njk b/_includes/layouts/home.njk index 6e75d04..35df4f1 100644 --- a/_includes/layouts/home.njk +++ b/_includes/layouts/home.njk @@ -1,16 +1,5 @@ --- layout: layouts/base.njk --- - -{%- css %}{% include "public/css/message-box.css" %}{% endcss %} -
-
    -
  1. Edit _data/metadata.js with your blog’s information.
  2. -
  3. (Optional) Edit eleventy.config.js with your configuration preferences.
  4. -
  5. Delete this message from _includes/layouts/home.njk.
  6. -
-

This is an Eleventy project created from the eleventy-base-blog repo.

-
- {{ content | safe }} diff --git a/eleventy.config.js b/eleventy.config.js index e2a14d9..76ad140 100644 --- a/eleventy.config.js +++ b/eleventy.config.js @@ -64,11 +64,11 @@ export default async function(eleventyConfig) { }, metadata: { language: "en", - title: "Blog Title", - subtitle: "This is a longer description about your blog.", - base: "https://example.com/", + title: "Chris Kaczor", + subtitle: "Code, Critters, and whatever I feel like writing about.", + base: "https://chriskaczor.com/", author: { - name: "Your Name" + name: "Chris Kaczor" } } }); @@ -103,6 +103,23 @@ export default async function(eleventyConfig) { return (new Date()).toISOString(); }); + // Categories + eleventyConfig.addCollection('categoryList', collection => { + let catSet = {}; + collection.getAll().forEach(item => { + if (!item.data.categories) return; + item.data.categories.filter( + cat => !['posts', 'all'].includes(cat) + ).forEach( + cat => { + if (!catSet[cat]) { catSet[cat] = []; } + catSet[cat].push(item) + } + ); + }); + return catSet; + }); + // Features to make your build faster (when you need them) // If your passthrough copy gets heavy and cumbersome, add this line