middleman/middleman-asciidoc

Make document object available to template

mojavelinux opened this issue · 1 comments

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.

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