Skip to content

Instantly share code, notes, and snippets.

@rascode
Last active October 6, 2022 00:09
Show Gist options
  • Save rascode/ad5b85e215aa29342108707233206b3a to your computer and use it in GitHub Desktop.
Save rascode/ad5b85e215aa29342108707233206b3a to your computer and use it in GitHub Desktop.
11ty Configuration Templates
const pluginWebc = require("@11ty/eleventy-plugin-webc");
module.exports = function(eleventyConfig) {
//passthroughs
eleventyConfig.addPassthroughCopy("manifest.json"); //site manifest file
eleventyConfig.addPassthroughCopy(".prettierrc"); //prettier config file
eleventyConfig.addPassthroughCopy({"src/assets/" : "/assets/"}); // assets directory
eleventyConfig.addPassthroughCopy({"src/styles" : "/styles/"); //css directory
//plugins
eleventyConfig.addPlugin(pluginWebc, {components: "includes/components/**/*.webc",}); //global webc support
return {
dir:{
input: "src/content",
data: "../data",
includes: "../templates/includes",
layouts: "../templates/layouts",
output: "dist"
},
dataTemplateEngine: "njk",
markdownTemplateEngine: 'njk',
htmlTemplateEngine: "njk",
templateFormats: ["html", "liquid", "njk", "md", "webc"],
}
};
# Mac Files
.DS_Store
# NodeJS
node_modules
# Environment Variables
.env
# Build Folders
dist
build
public
_dist
_build
_public
@rascode
Copy link
Author

rascode commented Nov 17, 2021

Note

  • Any paths listed in your project’s .gitignore file are automatically ignored—you don’t need to duplicate them to your .eleventyignore file.
  • Layouts, include files, extends, partials, macros, and other lower level template features aren’t relevant to this feature.

Read more on 11ty ignore files in the official 11ty docs.

@rascode
Copy link
Author

rascode commented Feb 13, 2022

Updated eleventy configuration file include defaults for passthroughs, ignored files and personalized standard folder structure.

@rascode
Copy link
Author

rascode commented Feb 13, 2022

Added comments to .gitignore file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment