From b48f80dac09b80369a652b20c6a9ce2db8f8c556 Mon Sep 17 00:00:00 2001 From: Addy Osmani Date: Tue, 12 May 2020 18:15:49 -0700 Subject: [PATCH] [infra] add eleventy syntax highlighting --- site/.eleventy.js | 4 ++++ site/package.json | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/site/.eleventy.js b/site/.eleventy.js index 23b4fd58..eae6aca9 100644 --- a/site/.eleventy.js +++ b/site/.eleventy.js @@ -1,7 +1,11 @@ const markdownIt = require('markdown-it'); const htmlminifier = require('html-minifier'); +const syntaxHighlight = require("@11ty/eleventy-plugin-syntaxhighlight"); module.exports = function(eleventyConfig) { + eleventyConfig.addPlugin(syntaxHighlight, { + templateFormants: ["md", "js", "html"] + }); eleventyConfig.addPassthroughCopy("src/assets"); eleventyConfig.addPassthroughCopy("src/styles"); eleventyConfig.addPassthroughCopy("src/script.js"); diff --git a/site/package.json b/site/package.json index f1213bb3..6dfc6f0a 100644 --- a/site/package.json +++ b/site/package.json @@ -12,6 +12,7 @@ }, "license": "Apache-2.0", "dependencies": { + "@11ty/eleventy-plugin-syntaxhighlight": "^3.0.1", "html-minifier": "^4.0.0" } -} \ No newline at end of file +}