aboutsummaryrefslogtreecommitdiff
path: root/eleventy.config.js
diff options
context:
space:
mode:
Diffstat (limited to 'eleventy.config.js')
-rw-r--r--eleventy.config.js87
1 files changed, 87 insertions, 0 deletions
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");
+}