Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Custom CSS Classes #42

Open
aress31 opened this issue May 20, 2023 · 0 comments
Open

Add Custom CSS Classes #42

aress31 opened this issue May 20, 2023 · 0 comments

Comments

@aress31
Copy link

aress31 commented May 20, 2023

So far to add a custom CSS class to the TOC is to use the following workaround:

  eleventyConfig.addPlugin(toc, {
    wrapper: undefined,
  });

  eleventyConfig.addFilter("bootstrapToc", (tocHtml) => {
    if (tocHtml) {
      return tocHtml
        .replace(/<ol>/g, `<ol class="list-group">`)
        .replace(/<li>/g, `<li class="list-group-item">`);
    }
    return tocHtml;
  });

Would be nice to have a built-in feature to achieve the same results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant