Last active
May 11, 2021 11:46
-
-
Save Narottam04/79600b48db8fcc26b78337883749e4be to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const syntaxHighlight = require("@11ty/eleventy-plugin-syntaxhighlight"); | |
module.exports = function (eleventyConfig) { | |
eleventyConfig.addPassthroughCopy("images"); | |
eleventyConfig.addPassthroughCopy("admin"); | |
eleventyConfig.addPassthroughCopy("CSS"); | |
eleventyConfig.addPassthroughCopy("Javascript"); | |
eleventyConfig.addPassthroughCopy("manifest.webmanifest"); | |
eleventyConfig.addPassthroughCopy("sw.js"); | |
eleventyConfig.addPassthroughCopy(".well-known"); | |
eleventyConfig.addPassthroughCopy("app"); | |
eleventyConfig.addPassthroughCopy("OneSignalSDKUpdaterWorker.js"); | |
eleventyConfig.addPassthroughCopy("OneSignalSDKWorker.js"); | |
eleventyConfig.addWatchTarget("images"); | |
eleventyConfig.addWatchTarget("admin"); | |
eleventyConfig.addWatchTarget("CSS"); | |
eleventyConfig.addWatchTarget("Javascript"); | |
eleventyConfig.addWatchTarget("manifest.webmanifest"); | |
eleventyConfig.addWatchTarget("sw.js"); | |
eleventyConfig.addWatchTarget(".well-known"); | |
eleventyConfig.addWatchTarget("app"); | |
eleventyConfig.addWatchTarget("OneSignalSDKUpdaterWorker.js"); | |
eleventyConfig.addWatchTarget("OneSignalSDKWorker.js"); | |
// syntax highlighting plugin | |
eleventyConfig.addPlugin(syntaxHighlight); | |
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); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment