-
Notifications
You must be signed in to change notification settings - Fork 19
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
TemplateContentRenderError
was thrown > cheerio.load() expects a string
#21
Comments
I found out that this happens when you try to use |
Hm, that means maintaining a separate almost duplicate layout only for the page(s) which need a TOC. |
You could use a custom flag on pages you want / don't want a TOC and read that flag in your layout? Something along those lines: {% if page.includeToc %}
<aside>
{{ content | toc }}
</aside>
{% endif %} I myself would prefer having the TOC at a predefined position within the article (after the h1 and the abstract, before the first h2), pretty much like you explained. But that doesn't seem feasible from within the layout...? (oh, and #22 is also a blocker for me) |
Thanks for creating this issue. First, the troubleshooting you all have done is correct: because this plugin provides a filter on Second, could you help me understand how using a layout template is a drawback here? As I approach this problem, that seems to be the right solution: since @mariusa - do you have a link to Jekyll documentation/source for its TOC generation/insertion? I'll take a look at that to see if anything's comparable with Eleventy's processing pipeline. |
Example: a site with regular HTML pages, but also some .md pages (FAQ). Both use the same layout, which has header & footer. FAQ page:
This works with Jekyll. Good things:
Jekyll how-to (no plugins required, using kramdown) |
Hi, getting this error
with a simple .md file
The text was updated successfully, but these errors were encountered: