npm install @11ty/eleventy-plugin-syntaxhighlight --save-dev
eleventy.config.jsimport syntaxHighlight from '@11ty/eleventy-plugin-syntaxhighlight';
eleventy.config.js in default functioneleventyConfig.addPlugin(syntaxHighlight);
public and css folders for local filesmkdir public public/css
cp node_modules/prismjs/themes/prism-tomorrow.css public/css/prism-tomorrow.css
eleventyConfig.addPassthroughCopy("public");
<link rel="stylesheet" href="/public/css/prism-tomorrow.css">
npm run serve
basic-javascript code snippets will now have syntax highlightinggit add .
git commit -m 'Adds prism syntax highlighting'
git push
Next:
Add Prism toolbar