Turned the How To Page into a Blog
I realized that the How To page was getting unwieldy and difficult to manage. Also, it was doing a bad job of showing how this website evolved over time. I thought the right fix was to make the How To page into a blog. Following steps very similar to those I took when I made the blog, this is what I did:
- In
/srcmade a/howtofolder. - In
/howtomadehowto.jsonwith code similar toblog.json:
{
"layout": "/layouts/base.njk",
"tags": "howto"
}
- In
.eleventy.json, edited the tag list filter to filter out the "howto" tag. The updated code looks like this:
eleventyConfig.addFilter("filterTagList", function filterTagList(tags) {
return (tags || []).filter(tag => ["all", "posts", "howto"].indexOf(tag) === -1);
});
- Renamed
howto.mdtoold-howto.mdand edited its front matter to remove it from the navigation bar. - Made a new file in
/srcnamedhowto.mdwith the same front matter as the old "How To" page:
---
title: How To
layout: /layouts/base
eleventyNavigation:
key: How To
order: 3
---
- In
/layoutsmadehowto.njkand copied the code fromblog.njkto the new file. - Edited the code in
howto.njk, replacing everyting in<main></main>with this:
{{ content | safe }}
{% for posts in collections.howto %}
<article>
<strong><a href="{{ posts.url }}">{{ posts.data.title }}</a></strong><br>
<em>{{ posts.data.blurb }}</em><br>
</article>
{% endfor %}
- For each section in
old-howto.md, created a new Markdown page in/howto, copied the section to the new page, and added front matter with a title and blurb. - Copied the introductory section from
old-howto.mdto the newhowto.md.
If you are curious, you can see the old How To page here.