crisp-theme.git

git clone https://git.crispbyte.dev/crisp-theme.git

cheddar  ·  2025-05-01

eleventy.config.js

 1import { feedPlugin } from "@11ty/eleventy-plugin-rss";
 2
 3import metadata from "./_data/metadata.js";
 4import pluginFilters from "./_config/filters.js";
 5
 6export default async function(eleventyConfig) {
 7  eleventyConfig.setUseGitIgnore(false);
 8
 9  eleventyConfig.addPlugin(pluginFilters);
10
11  eleventyConfig.addPlugin(feedPlugin, {
12    type: "atom",
13    outputPath: "/feed.xml",
14    collection: {
15      name: "posts",
16      limit: 10
17    },
18    metadata: {
19      title: metadata.title,
20      subtitle: metadata.description,
21      base: metadata.url,
22      author: {
23        name: metadata.author.name
24      }
25    }
26  })
27
28  eleventyConfig.addCollection("series", collectionsApi => {
29    const seriesNames = collectionsApi.
30      getFilteredByTag("posts").
31      filter(post => post.data.series != null).
32      map(post => post.data.series.name).
33      sort();
34
35    return [...new Set(seriesNames)];
36  });
37
38  eleventyConfig.addCollection("site_nav", collectionsApi => {
39    return collectionsApi.
40      getAll().
41      filter(page => page.data.nav_order).
42      sort((a, b) => a.data.nav_order - b.data.nav_order);
43  });
44
45  eleventyConfig.addPassthroughCopy({
46    "./content/resources/": "/"
47  });
48};
49
50export const config = {
51  dir: {
52    input: 'content',
53    includes: '../_includes',
54    data: '../_data',
55    output: 'dist'
56  }
57};