Skip to content

Commit

Permalink
Add anchors to headers
Browse files Browse the repository at this point in the history
  • Loading branch information
AramZS committed Jul 25, 2021
1 parent 7e0f8e6 commit f7e81ae
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
4 changes: 3 additions & 1 deletion .eleventy.js
Expand Up @@ -268,9 +268,11 @@ module.exports = function (eleventyConfig) {
return ""; // use external default escaping
},**/
};
var slugify = require('slugify')
var markdownSetup = mdProcessor(options)
.use(require("markdown-it-replace-link"))
.use(require("markdown-it-todo"));
.use(require("markdown-it-todo"))
.use(require('markdown-it-anchor'), { slugify: s => slugify(s) });

// via https://github.com/markdown-it/markdown-it/blob/master/docs/architecture.md#renderer
var defaultRender =
Expand Down
12 changes: 8 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Expand Up @@ -25,8 +25,10 @@
},
"dependencies": {
"dotenv": "^10.0.0",
"markdown-it-anchor": "^8.1.2",
"normalize-path": "^3.0.0",
"nunjucks": "^3.2.3",
"prismjs": "^1.23.0"
"prismjs": "^1.23.0",
"slugify": "^1.6.0"
}
}

0 comments on commit f7e81ae

Please sign in to comment.