Skip to content

Instantly share code, notes, and snippets.

@Aankhen
Forked from Narottam04/.eleventy.js
Last active May 2, 2021 10:19
Show Gist options
  • Save Aankhen/72d1284ca259c573dd0624323f327ace to your computer and use it in GitHub Desktop.
Save Aankhen/72d1284ca259c573dd0624323f327ace to your computer and use it in GitHub Desktop.
module.exports = function (eleventyConfig) {
eleventyConfig.addPassthroughCopy("images");
eleventyConfig.addPassthroughCopy("admin");
eleventyConfig.addPassthroughCopy("CSS");
eleventyConfig.addPassthroughCopy("Javascript");
eleventyConfig.addWatchTarget("images");
eleventyConfig.addWatchTarget("admin");
eleventyConfig.addWatchTarget("CSS");
eleventyConfig.addWatchTarget("Javascript");
let markdownIt = require("markdown-it");
let markdownItOptions = {
html: true,
};
const markdownItPlugins = [
["markdown-it-image-lazy-loading"],
[
"markdown-it-link-attributes",
{
attrs: {
target: "_blank",
rel: "noopener noreferrer",
},
},
],
];
const markdownLibrary = markdownItPlugins.reduce(
(m, [plugin, settings]) =>
m.use(require(plugin), settings),
markdownIt(markdownItOptions)
);
eleventyConfig.setLibrary("md", markdownLibrary);
};
{
"name": "WEBDRIP-BLOG",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "eleventy --serve",
"build": "eleventy"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"@11ty/eleventy": "^0.12.1",
"markdown-it-for-inline": "^0.1.1",
"markdown-it-image-lazy-loading": "^1.1.0",
"markdown-it-link-attributes": "^3.0.0"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment