middleman / middleman-asciidoc

:beginner: AsciiDoc support for Middleman 4. (In Middleman 3, AsciiDoc support is provided by a core extension).
https://middlemanapp.com
Other
27 stars 12 forks source link

Make document object available to template #63

Closed mojavelinux closed 6 years ago

mojavelinux commented 6 years ago

Make the Asciidoctor::Document object for the current page (AsciiDoc document) available to the template as document. This allows the template to consult the document structure and add page-specific elements to other regions of the UI. One example is a sidebar table of contents.

If there is a cost associated with this behavior, it should be concealed behind an option.

mojavelinux commented 6 years ago

Add the document to the current_page.data hash so it can be accessed using current_page.data.document.