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

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -