Documentation/.eleventy.js
n ae684fbad4 Migrate to Codeberg Design Kit (#132) (#149)
TODO:
- [x] Hide navbar items on small screens
- [x] Fix `<blockquote>` rendering
- [x] Fix `<code>` rendering
- [ ] LibreJS Compatibility

Reviewed-on: https://codeberg.org/Codeberg/Documentation/pulls/149
Co-authored-by: n <n@noreply.codeberg.org>
Co-committed-by: n <n@noreply.codeberg.org>
2021-07-26 12:07:23 +02:00

30 lines
962 B
JavaScript

const navigationPlugin = require("@11ty/eleventy-navigation")
const syntaxHighlightingPlugin = require("@11ty/eleventy-plugin-syntaxhighlight")
const markdownIt = require('markdown-it');
const markdownItClass = require('@toycode/markdown-it-class');
module.exports = function(eleventyConfig) {
eleventyConfig.addPlugin(navigationPlugin)
eleventyConfig.addPlugin(syntaxHighlightingPlugin)
eleventyConfig.addPassthroughCopy("assets")
eleventyConfig.addPassthroughCopy("fonts")
eleventyConfig.addShortcode("fas_icon", function(name) { return `<span class="fas fa-${name}"></span>` })
const mapping = {
h2: 'content-title',h3: 'content-title',h4: 'content-title',h5: 'content-title',h6: 'content-title',
table: 'table',
blockquote: 'alert'
};
const md = markdownIt({ linkify: false, html: true });
md.use(markdownItClass, mapping);
eleventyConfig.setLibrary('md', md);
return {
dir: {
input: "content"
}
}
}