Add next / previous cards to posts

This commit is contained in:
2024-01-02 16:43:56 -06:00
parent bd2b505a5e
commit 3140ef0b72
16 changed files with 233 additions and 28 deletions

View File

@ -1,8 +1,17 @@
# nathanupchurch.com - Based on eleventy-base-blog v8
# nathanupchurch.com
My blog, based on the very helpful eleventy-base-blog v8.
![](https://upchur.ch/piwigo/i.php?/upload/2023/09/22/20230922131353-32037f24-la.png)
### Implementation Notes
## Documentation
- `content/blog/` has the blog posts but really they can live in any directory. They need only the `posts` tag to be included in the blog posts [collection](https://www.11ty.dev/docs/collections/).
- Use the `eleventyNavigation` key (via the [Eleventy Navigation plugin](https://www.11ty.dev/docs/plugins/navigation/)) in your front matter to add a template to the top level site navigation. This is in use on `content/index.njk` and `content/about/index.md`.
### Metadata
Site metadata such as author info, title, etc. lives in _data/metadata.js. Links on the /me page, and default post images are also configured here.
### How to add a cowsay to a post with the custom nunjucks filter
You can use the `cowsay` filter to output a captioned `<figure>` containing a copy of an output from the cowsay program. Instead of using the usual three backticks, this method is accessible to visually impaired users thanks to the automatic captioning. Here's how to do it:
1. Add a copy of the cowsay output you'd like to display to _data/cowList.js. Be sure and escape any backslashes.
2. Use the filter like this: `{{ cowList.name | cowsay | safe }}`.
The `safe` filter is necessary so that Eleventy doesn't sanitize our HTML.