I have a ready markdown file wanna to display on html. Understand that jekyll has done the job, but I wanna to have a floating side menu, but I can't find any document from jekyll. Can anyone help?
Asked
Active
Viewed 2,486 times
2 Answers
2
Use the Leap day theme will generate a floating menu for table of contents
of current page.
It is one of the github pages Supported themes

Happy
- 757
- 9
- 18
-2
If you want a table of contents in Markdown, you can use this answer. If you want to create a menu, you can an include whith this content:
<ul>
<li {% if page.url contains '/getting-started' %}class="active"{% endif %}><a href="/getting-started/">Getting started</a></li>
<li {% if page.url contains '/without-plugin' %}class="active"{% endif %}><a href="/without-plugins/">Without plugins</a></li>
<li {% if page.url contains '/about' %}class="active"{% endif %}><a href="/about/">About</a></li>
<li {% if page.url contains '/blog' %}class="active"{% endif %}><a href="/blog/">Blog</a></li>
</ul>
Use the include in your layout file, like this:
{% include simple-menu.html %}
Source: https://jekyllcodex.org/without-plugin/simple-menu
Note that creating a floating menu in plain Markdown is not possible. That is why you have not received any 'real' answers. However, Markdown does support HTML and Github Pages has automatic TOC's. But adding HTML to your Markdown file is an ugly hack and you might not be using Github Pages/redcarpet.

Mr. Hugo
- 11,887
- 3
- 42
- 60