Sorted navigation menu with Jekyll and Liquid

后端 未结 10 2177
清酒与你
清酒与你 2020-12-07 11:57

I\'m constructing a static site (no blog) with Jekyll/Liquid. I want it to have an auto-generated navigation menu that lists all existing pages and highlight the current pag

10条回答
  •  天命终不由人
    2020-12-07 12:58

    The simplest solution would be to prefix the filename of your pages with an index like this:

    00-home.html 01-services.html 02-page3.html

    Pages are be ordered by filename. However, now you'll have ugly urls.

    In your yaml front matter sections you can override the generated url by setting the permalink variable.

    For instance:

    ---
    layout: default
    permalink: index.html
    ---
    

提交回复
热议问题