Open Heydon opened 6 years ago
Sorry for the (inexcusably) late reply; I'll test this out. Can you provide any other info about this particular Eleventy config?
In my case I have tried two ways and options are not being uptaken by the plugin, they are just being ignored. I was to use UL instead of OL:
const tocOptions = {
tags: ['h2', 'h3', 'h4'], // which heading tags are selected
wrapper: 'nav', // element to put around the root `ol`
wrapperClass: 'toc-abc', // class for the element around the root `ol`
ul: true,
flat: true,
}
module.exports = function(eleventyConfig) {
//Plugins
eleventyConfig.setLibrary(
'md',
markdownIt(mdOptions)
.use(markdownItAnchor, mdAnchorOpts)
)
//eleventyConfig.addPlugin(pluginTOC,tocOptions);
eleventyConfig.addPlugin(pluginTOC, {
tags: ['h2', 'h3', 'h4'], // which heading tags are selected
wrapper: 'nav', // element to put around the root `ol`
wrapperClass: 'toc-abc', // class for the element around the root `ol`
ul: true,
flat: false,
});
@helmutgranda Just published 1.1.0 which supports .eleventy.js
options in addPlugin
@Heydon Recent updates also fixed an issue with JSON options in templates. If you're still using this plugin, can you update the version and see if that works for you? Thanks!
This issue is >1y old and should be resolved by prior work. However, if anyone is still having this issue, I'll give a week to comment, then close. Thanks!
Hi! So far so good, except when I pass the JSON string in your example, the template no longer parses (
Having trouble writing template: docs/components/card/index.html (TemplateWriterWriteError)
).Any idea what that might be? Thanks.