Files
leecat.art/eleventy.config.js

74 lines
1.8 KiB
JavaScript
Raw Normal View History

2026-02-17 21:11:03 -08:00
import { eleventyImageTransformPlugin } from "@11ty/eleventy-img";
import eleventyNavigationPlugin from "@11ty/eleventy-navigation";
import { feedPlugin } from "@11ty/eleventy-plugin-rss";
import syntaxHighlight from "@11ty/eleventy-plugin-syntaxhighlight";
2026-02-17 21:11:03 -08:00
2026-02-17 20:03:12 -08:00
export default async function(eleventyConfig) {
/* Filters */
eleventyConfig.addFilter("removeBasicTags", (tags) => {
return tags.filter(tag => ["all", "posts", "gallery", "reference"].indexOf(tag) === -1);
});
2026-02-17 21:11:03 -08:00
/* Passthroughs */
2026-02-17 20:03:12 -08:00
eleventyConfig.addPassthroughCopy({"css": "assets/css"});
2026-02-17 21:11:03 -08:00
/* Plugins */
/* RSS */
eleventyConfig.addPlugin(feedPlugin, {
type: "atom", // or "rss", "json"
outputPath: "/feed.xml",
collection: {
name: "posts", // iterate over `collections.posts`
limit: 10, // 0 means no limit
},
metadata: {
language: "en",
title: "hello hello",
subtitle: "Lee Cattarin... on the internet!",
base: "https://leecat.art",
author: {
name: "Lee Cattarin",
email: "lee.cattarin@gmail.com",
}
}
});
/* Images */
eleventyConfig.addPlugin(eleventyImageTransformPlugin, {
// output image formats
formats: ["auto"],
// output image widths
widths: [800],
// optional, attributes assigned on <img> nodes override these values
htmlOptions: {
imgAttributes: {
loading: "lazy",
decoding: "async",
},
},
});
/* Navigation */
eleventyConfig.addPlugin(eleventyNavigationPlugin);
/* Syntax highlighting */
eleventyConfig.addPlugin(syntaxHighlight);
2026-02-17 21:11:03 -08:00
/* Watch when serving */
eleventyConfig.addWatchTarget("css");
2026-02-17 20:03:12 -08:00
};
export const config = {
dir: {
2026-02-17 21:11:03 -08:00
input: "src",
includes: "../_includes",
layouts: "../_includes/layouts",
2026-02-17 21:11:03 -08:00
data: "../_data"
2026-02-17 20:03:12 -08:00
},
markdownTemplateEngine: "njk",
htmlTemplateEngine: "njk",
templateFormats: ["html", "md", "njk"],
};