Update to Eleventy 1.0

This commit is contained in:
Zach Leatherman
2022-01-08 14:35:24 -06:00
parent e058ac3028
commit 933b2886d1
2 changed files with 17 additions and 23 deletions

View File

@@ -7,14 +7,15 @@ const markdownIt = require("markdown-it");
const markdownItAnchor = require("markdown-it-anchor");
module.exports = function(eleventyConfig) {
// Copy the `img` and `css` folders to the output
eleventyConfig.addPassthroughCopy("img");
eleventyConfig.addPassthroughCopy("css");
// Add plugins
eleventyConfig.addPlugin(pluginRss);
eleventyConfig.addPlugin(pluginSyntaxHighlight);
eleventyConfig.addPlugin(pluginNavigation);
// https://www.11ty.dev/docs/data-deep-merge/
eleventyConfig.setDataDeepMerge(true);
// Alias `layout: post` to `layout: layouts/post.njk`
eleventyConfig.addLayoutAlias("post", "layouts/post.njk");
@@ -60,10 +61,6 @@ module.exports = function(eleventyConfig) {
return filterTagList([...tagSet]);
});
// Copy the `img` and `css` folders to the output
eleventyConfig.addPassthroughCopy("img");
eleventyConfig.addPassthroughCopy("css");
// Customize Markdown library and settings:
let markdownLibrary = markdownIt({
html: true,
@@ -108,6 +105,12 @@ module.exports = function(eleventyConfig) {
"liquid"
],
// Pre-process *.md files with: (default: `liquid`)
markdownTemplateEngine: "njk",
// Pre-process *.html files with: (default: `liquid`)
htmlTemplateEngine: "njk",
// -----------------------------------------------------------------
// If your site deploys to a subdirectory, change `pathPrefix`.
// Dont worry about leading and trailing slashes, we normalize these.
@@ -122,15 +125,6 @@ module.exports = function(eleventyConfig) {
pathPrefix: "/",
// -----------------------------------------------------------------
// Pre-process *.md files with: (default: `liquid`)
markdownTemplateEngine: "njk",
// Pre-process *.html files with: (default: `liquid`)
htmlTemplateEngine: "njk",
// Opt-out of pre-processing global data JSON files: (default: `liquid`)
dataTemplateEngine: false,
// These are all optional (defaults are shown):
dir: {
input: ".",