Skip to content

Commit 500baa0

Browse files
davidlehnBigBlueHat
authored andcommitted
Add markdown-it plugins.
- Use `markdown-it-anchor`. - Use `markdown-it-attrs`.
1 parent 948fc20 commit 500baa0

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

.eleventy.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import markdownItAnchor from 'markdown-it-anchor';
2+
import markdownItAttrs from 'markdown-it-attrs';
13
import YAML from 'yaml';
24

35
// development host for playground proxy
@@ -15,6 +17,17 @@ const drafts = [
1517
];
1618

1719
export default async function(eleventyConfig) {
20+
eleventyConfig.amendLibrary('md', mdLib => {
21+
mdLib
22+
.set({
23+
html: true,
24+
linkify: true,
25+
typographer: true
26+
})
27+
.use(markdownItAnchor)
28+
.use(markdownItAttrs);
29+
});
30+
1831
eleventyConfig.addDataExtension('yaml', (contents) => YAML.parse(contents));
1932

2033
eleventyConfig.addPassthroughCopy('.htaccess');

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
"cbor2": "^2.0.1",
2929
"codemirror": "^6.0.2",
3030
"jsonld": "^9.0.0",
31+
"markdown-it-anchor": "^9.2.0",
32+
"markdown-it-attrs": "^4.3.1",
3133
"petite-vue": "^0.4.1",
3234
"rollup": "^4.53.2",
3335
"wrangler": "^4.49.0",

0 commit comments

Comments
 (0)