I want to provide hash links to page headers in a webpage menu. A web page is created using Jekyll, and its default layout is as follows:
<!DOCTYPE html> <html> {% include head.html %} <body> {% include header.html %} <div id="BigFatContainer"> {{ content }} {% include footer.html %} </div> </body> </html>
The title bar contains a menu for navigating various pages. I was able to add a table of contents to {{ content }} with the following Kramdown command:
* Point at which the TOC is attached {:toc}
You can use some ugly JavaScript hack to move this table of contents from {{ content }} and to header.html , but that would be a bad solution. It is not possible to put the {:toc} macro inside header.html , since it is not parsed by Kramdown, and even if you make sure it is parsed by Kramdown, using, for example, this plugin displays TOC header.md instead of TOC for the content.
source share