From ab4459ea2446ced5b93e84aa779f29d80708f374 Mon Sep 17 00:00:00 2001 From: Melody Horn Date: Sat, 14 Sep 2024 15:44:33 -0600 Subject: 11ty --- eleventy.config.js | 87 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 eleventy.config.js (limited to 'eleventy.config.js') diff --git a/eleventy.config.js b/eleventy.config.js new file mode 100644 index 0000000..0b839ca --- /dev/null +++ b/eleventy.config.js @@ -0,0 +1,87 @@ +import { InputPathToUrlTransformPlugin } from "@11ty/eleventy"; +import { feedPlugin } from "@11ty/eleventy-plugin-rss"; +import syntaxHighlight from "@11ty/eleventy-plugin-syntaxhighlight"; +import anchor from "markdown-it-anchor"; + +export default function (eleventyConfig) { + eleventyConfig.addPlugin(InputPathToUrlTransformPlugin); + eleventyConfig.addPlugin(syntaxHighlight, { + errorOnInvalidLanguage: true, + + init({ Prism }) { + // Conveniently, I only have to highlight a known and fairly small amount of syntax, so I can cheat. + Prism.languages.crowbar = { + number: /\d+/, + keyword: /\b(char|function|int|float|void|const)\b/, + function: /signal/, + operator: /\*/, + punctuation: /[()\[\];,]/, + }; + Prism.languages.duckscript = { + builtin: /if|else|end|eq|echo/, + string: /"[^"]+"/, + function: /print_fancy/, + operator: /\$\{|}|\./, + }; + Prism.languages.dyon = { + keyword: /fn|if|else/, + function: /handle_event|print_fancy/, + builtin: /println|typeof|str/, + string: /"[^"]+"/, + operator: /==|\+/, + punctuation: /[(){};]/, + }; + Prism.languages.ketos = { + builtin: /do|define|type-of|println/, + function: /handle-event|print-fancy/, + punctuation: /[()]/, + string: /"[^"]+"/, + }; + Prism.languages.peg = { + string: /'[^']+'/, + "class-name": /BasicType|Type|Expression/, + operator: /[←\/*]/, + punctuation: /[()]/, + }; + Prism.languages.rhai = { + keyword: /fn|if|else/, + function: /handle_event|print_fancy/, + builtin: /print|type_of/, + string: /"[^"]+"/, + operator: /==|\+/, + punctuation: /[(){};]/, + }; + Prism.languages.rune = { + keyword: /fn|match|if|is/, + function: /handle_event|print_fancy/, + builtin: /println|int/, + string: /"[^"]+"|`[^`]+`/, + operator: /=>/, + punctuation: /[(){},]/, + }; + Prism.languages.text = {}; + }, + }); + eleventyConfig.addPlugin(feedPlugin, { + type: "atom", + outputPath: "/feed.xml", + collection: { + name: "post", + limit: 0, + }, + metadata: { + language: "en", + title: "boringcactus", + subtitle: "boringcactus’s blog posts", + base: "https://www.boringcactus.com/", + author: { + name: "boringcactus / Melody Horn", + }, + }, + }); + + eleventyConfig.amendLibrary("md", (mdLib) => mdLib.use(anchor)); + + eleventyConfig.addPassthroughCopy("assets"); + eleventyConfig.ignores.add("README.md"); +} -- cgit v1.2.3