How this Site is Built
Context
#This blog is built with the Eleventy.js framework.
Markdown
#Most of my website is just Markdown that I've typed into a text editor and uploaded to GitHub
.
That's not the interesting bit, so I won't get into much detail here.
Instead, let's talk about the bits that aren't Markdown
.
It's important to me that almost everything I work on is as simple as possible. So for the less simple bits, perhaps I had an interesting reason.
What Else Is There?
#Plain Text
#Let's start with an easy one. There's no Markdown
specification for a SECURITY.TXT file.
So instead, I carve off that bit of the repository, and just serve the raw path and text of /.well-known/security.txt
.
I let Eleventy
know that's what needs to happen by a line in .eleventy.js
:
eleventyConfig.addPassthroughCopy(".well-known"); // security.txt
Art with JavaScript
#I make art with code, using the P5.js JavaScript framework.
To support this, and some other nonense, I need to serve JavaScript, CSS and image files unmodified:
eleventyConfig.addPassthroughCopy("css"); // Static files
eleventyConfig.addPassthroughCopy("js");
eleventyConfig.addPassthroughCopy("img");
This bit may go away in the near future, as I have added enough static art that I need to add a separate CDN (Content Delivery Network) soon.
Clever Bits in JavaScript (plugins)
#There's some bits of the site that I don't want to type over and over again. Most notably - the site navigation and RSS feeds. Thankfully, Eleventy
has plugins for that:
const eleventyNavigationPlugin = require("@11ty/eleventy-navigation");
const pluginRss = require("@11ty/eleventy-plugin-rss");