mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-10-23 10:43:05 +00:00
add markdown-it configuration
This commit is contained in:
1 parent
510297411b
commit
727bfb8ada
2 files changed
+15
-3
No files matched your search
+14
-3
@@ -1,5 +1,3 @@
|
||||
// const Card = require('./src/_includes/components/Card');
|
||||
|
||||
module.exports = function (eleventyConfig) {
|
||||
// Keeps the same directory structure.
|
||||
eleventyConfig.addPassthroughCopy("src/assets/");
|
||||
@@ -17,7 +15,20 @@ module.exports = function (eleventyConfig) {
|
||||
eleventyConfig.addWatchTarget("markdown/");
|
||||
eleventyConfig.addWatchTarget("components/Card.js");
|
||||
|
||||
// eleventyConfig.addShortcode("Card",Card);
|
||||
// this works because Eleventy also installs markdown-it
|
||||
const markdownIt = require("markdown-it");
|
||||
|
||||
// create a new markdown-it instance with the plugin
|
||||
const markdownItAnchor = require("markdown-it-anchor");
|
||||
|
||||
const markdownLib = markdownIt({
|
||||
html: true,
|
||||
breaks: true,
|
||||
linkify: true
|
||||
}).use(markdownItAnchor);
|
||||
|
||||
// replace the default markdown-it instance
|
||||
eleventyConfig.setLibrary("md", markdownLib);
|
||||
|
||||
return {
|
||||
dir: {
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
"devDependencies": {
|
||||
"@11ty/eleventy": "^1.0.1",
|
||||
"common-tags": "^1.8.2",
|
||||
"markdown-it-anchor": "^8.6.4",
|
||||
"tailwindcss": "^3.0.24"
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user