2024-05-06 18:43:37 +08:00
|
|
|
// Installed Plugins
|
2024-07-19 02:08:10 +08:00
|
|
|
import pluginRss from "@11ty/eleventy-plugin-rss";
|
2024-07-28 19:07:50 +08:00
|
|
|
import pluginEleventyNavigation from "@11ty/eleventy-navigation";
|
2024-08-02 15:42:34 +08:00
|
|
|
import pluginSyntaxHighlight from "@11ty/eleventy-plugin-syntaxhighlight";
|
2024-07-28 19:07:50 +08:00
|
|
|
import pluginEmbedEverything from "eleventy-plugin-embed-everything";
|
2024-09-05 23:49:01 +08:00
|
|
|
import pluginWordcount from "eleventy-plugin-wordcount-extended";
|
2024-07-28 19:08:51 +08:00
|
|
|
import pluginTOC from "@uncenter/eleventy-plugin-toc";
|
2024-04-13 01:54:48 +08:00
|
|
|
|
2024-07-28 19:05:49 +08:00
|
|
|
// Custom Configurations
|
|
|
|
import markdownItConfig from "./src/_config/markdown-it.js";
|
2024-07-28 19:48:35 +08:00
|
|
|
import filesConfig from "./src/_config/files.js";
|
2024-07-28 19:05:49 +08:00
|
|
|
import collectionsConfig from "./src/_config/collections.js";
|
2024-08-11 20:19:57 +08:00
|
|
|
import filtersConfig from "./src/_config/filters.js";
|
2024-07-28 19:05:49 +08:00
|
|
|
import shortCodesConfig from "./src/_config/shortcodes.js";
|
2024-07-19 02:08:10 +08:00
|
|
|
|
2024-07-28 17:30:43 +08:00
|
|
|
export default function(eleventyConfig) {
|
2024-05-07 01:01:15 +08:00
|
|
|
// Installed Plugins
|
2024-04-11 20:18:03 +08:00
|
|
|
eleventyConfig.addPlugin(pluginRss);
|
2024-07-28 19:07:50 +08:00
|
|
|
eleventyConfig.addPlugin(pluginEleventyNavigation);
|
2024-08-02 15:42:34 +08:00
|
|
|
eleventyConfig.addPlugin(pluginSyntaxHighlight, { preAttributes: { tabindex: 0 } });
|
2024-07-28 19:07:50 +08:00
|
|
|
eleventyConfig.addPlugin(pluginEmbedEverything, { add: ['soundcloud'] });
|
2024-09-05 23:49:01 +08:00
|
|
|
eleventyConfig.addPlugin(pluginWordcount);
|
2024-07-28 19:05:49 +08:00
|
|
|
eleventyConfig.addPlugin(pluginTOC, {
|
|
|
|
tags: ['h2', 'h3', 'h4', 'h5', 'h6'],
|
|
|
|
wrapper: function (toc) {
|
|
|
|
return `<nav class="toc" aria-labelledby="toc-heading">${toc}</nav>`;
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
// Custom Configurations
|
|
|
|
eleventyConfig.addPlugin(markdownItConfig);
|
2024-07-28 19:48:35 +08:00
|
|
|
eleventyConfig.addPlugin(filesConfig);
|
2024-07-28 19:05:49 +08:00
|
|
|
eleventyConfig.addPlugin(collectionsConfig);
|
2024-08-11 20:19:57 +08:00
|
|
|
eleventyConfig.addPlugin(filtersConfig);
|
2024-07-28 19:05:49 +08:00
|
|
|
eleventyConfig.addPlugin(shortCodesConfig);
|
2024-07-18 22:11:18 +08:00
|
|
|
|
|
|
|
// Eleventy bundle plugin
|
2024-07-18 21:08:32 +08:00
|
|
|
eleventyConfig.addBundle("css");
|
2024-07-19 08:35:56 +08:00
|
|
|
eleventyConfig.addBundle("js", { toFileDirectory: "assets/js" });
|
2024-04-13 01:54:48 +08:00
|
|
|
|
2024-04-06 12:15:14 +08:00
|
|
|
return {
|
2024-09-14 21:14:07 +08:00
|
|
|
markdownTemplateEngine: "njk",
|
2024-10-03 23:02:13 +08:00
|
|
|
htmlTemplateEngine: "njk",
|
2024-04-06 12:15:14 +08:00
|
|
|
dir: {
|
|
|
|
input: "src"
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|