Open mmilano opened 6 years ago
What do you need this for?
well....since you asked... there are actually a couple of directions stuffed into the question.
context:
Ultimately, i am attempting to build a helper that parses the page's body content and generates a table of contents for the page. Call the helper toc.js.
The process i am working with is:
i experimented with adding the body content with in the nameOfThePage.html page. infinite render loop. node crashes. makes a certain sense, if it is not checked internally.
i tried making toc.js a block helper in the layout-page, with {{> body}} as the block content, like so:
{{#toc}}
{{> body}}
{{/toc}}
but that isn't really the right spirit of how it should work.
I considered adding the page to the pageData object, but that feels needlessly bloated.
Ive tried accessing panini itself, and getting the body content. I can get part-way, but it is the raw content - pre-rendering - and I cant figure out how to get it post-rendered.
modification assistance request: Are there any suggestions about how to modify panini.render() to
right now, that will result in a render loop.
advice?
or, alternatively, a way to access the rendered body - the var page in render() or better yet, the partial 'body' - from other helpers?