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

Feature Request: allow filters on toc tag #128

Open
whicks1 opened this issue Nov 11, 2020 · 0 comments
Open

Feature Request: allow filters on toc tag #128

whicks1 opened this issue Nov 11, 2020 · 0 comments

Comments

@whicks1
Copy link

whicks1 commented Nov 11, 2020

{% toc %} currently only renders the TOC based off of the {{ content }} var. I've run into scenarios where I needed to template in additional headings and metadata-generated content before or after the content as boilerplate HTML, that would still be nice to have in a table of contents. I'm supposing it might look like:

{%- capture key_concepts_heading -%}<h2>Key Concepts</h2>{% endcapture -%}
{%- capture license_heading -%}<h2>License</h2>{% endcapture -%}

{% toc | prepend: key_concepts_heading | append: license_heading %}

...
{{ key_concepts_heading }}
{{ page.key_concepts }}
{{ content }}
{{ license_heading }}
{{ page.license }}
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