Move code block for custom container shortcode
This commit is contained in:
parent
d059c8ff30
commit
a12bd804a8
|
@ -63,13 +63,6 @@ module.exports = function (eleventyConfig) {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
// Paired shortcode: custom container
|
|
||||||
eleventyConfig.addPairedShortcode('container', (children, el, className) => {
|
|
||||||
const classMarkup = className ? ` class="${className}"` : "";
|
|
||||||
const content = markdownLibrary.render(children);
|
|
||||||
return `<${el}${classMarkup}>${content}</${el}>`;
|
|
||||||
});
|
|
||||||
|
|
||||||
/* Markdown Overrides */
|
/* Markdown Overrides */
|
||||||
let markdownLibrary = markdownIt({
|
let markdownLibrary = markdownIt({
|
||||||
html: true,
|
html: true,
|
||||||
|
@ -79,6 +72,13 @@ module.exports = function (eleventyConfig) {
|
||||||
.use(require("markdown-it-bracketed-spans"))
|
.use(require("markdown-it-bracketed-spans"))
|
||||||
.use(require("markdown-it-deflist"));
|
.use(require("markdown-it-deflist"));
|
||||||
|
|
||||||
|
// Paired shortcode: custom container
|
||||||
|
eleventyConfig.addPairedShortcode('container', (children, el, className) => {
|
||||||
|
const classMarkup = className ? ` class="${className}"` : "";
|
||||||
|
const content = markdownLibrary.render(children);
|
||||||
|
return `<${el}${classMarkup}>${content}</${el}>`;
|
||||||
|
});
|
||||||
|
|
||||||
// Paired shorcode: Spoiler accordion
|
// Paired shorcode: Spoiler accordion
|
||||||
eleventyConfig.addPairedShortcode('spoiler', (content, hint) => {
|
eleventyConfig.addPairedShortcode('spoiler', (content, hint) => {
|
||||||
const hintMarkup = markdownLibrary.renderInline(hint);
|
const hintMarkup = markdownLibrary.renderInline(hint);
|
||||||
|
|
Loading…
Reference in New Issue