jekyll - Iterate over markdown headers to create navigation menu -
i make single-large-page menu on side links directly sections inside single page. similar the bootstrap manual pages.
i write page content in markdown. how can make jekyll automatically create navigation menu headers in markdown page? i.e. loop/iterate on headers insert menu items?
i believe can done plugin. because running on github pages, can't use plugins.
this method not automatic, achieve same result.
_config.yml
nav: - page: header 1 permalink: #header-one - page: header 2 permalink: #header-two
default.html
{% n in site.nav %} <li><a href="{{ n.permalink }}">{{ n.page }}</a></li> {% endfor %}
Comments
Post a Comment