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

View File

@ -1,6 +1,6 @@
{ {
"name": "eleventy-base-blog", "name": "eleventy-base-blog",
"version": "5.0.2", "version": "6.0.0",
"description": "A starter repository for a blog web site using the Eleventy static site generator.", "description": "A starter repository for a blog web site using the Eleventy static site generator.",
"scripts": { "scripts": {
"build": "eleventy", "build": "eleventy",
@ -24,12 +24,12 @@
}, },
"homepage": "https://github.com/11ty/eleventy-base-blog#readme", "homepage": "https://github.com/11ty/eleventy-base-blog#readme",
"devDependencies": { "devDependencies": {
"@11ty/eleventy": "^0.12.1", "@11ty/eleventy": "^1.0.0",
"@11ty/eleventy-navigation": "^0.3.2", "@11ty/eleventy-navigation": "^0.3.2",
"@11ty/eleventy-plugin-rss": "^1.1.1", "@11ty/eleventy-plugin-rss": "^1.1.2",
"@11ty/eleventy-plugin-syntaxhighlight": "^3.1.2", "@11ty/eleventy-plugin-syntaxhighlight": "^3.1.3",
"luxon": "^1.26.0", "luxon": "^2.3.0",
"markdown-it": "^12.1.0", "markdown-it": "^12.3.2",
"markdown-it-anchor": "^8.1.2" "markdown-it-anchor": "^8.4.1"
} }
} }