From a12bd804a8c26eda20d2f16aad1257191f57292e Mon Sep 17 00:00:00 2001 From: Helen Chong <119173961+helenclx@users.noreply.github.com> Date: Tue, 7 May 2024 10:26:21 +0800 Subject: [PATCH] Move code block for custom container shortcode --- eleventy.config.md.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/eleventy.config.md.js b/eleventy.config.md.js index 2fd7b84c..5fe948c1 100644 --- a/eleventy.config.md.js +++ b/eleventy.config.md.js @@ -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}`; - }); - /* Markdown Overrides */ let markdownLibrary = markdownIt({ html: true, @@ -79,6 +72,13 @@ module.exports = function (eleventyConfig) { .use(require("markdown-it-bracketed-spans")) .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}`; + }); + // Paired shorcode: Spoiler accordion eleventyConfig.addPairedShortcode('spoiler', (content, hint) => { const hintMarkup = markdownLibrary.renderInline(hint);