Friday, January 22, 2016

Hugo single page index: _index.md

Hugo by default lists all posts or contents of pages with name _index.md on the mainpage.

When you have multiple _index.md files in various folders, it tries to list them all.

When you just want to display single _index.md on the content/_index.md root, use the following code on layouts/index.html.


          {{ range where .Site.Pages "RelPermalink" "/_index/" }}
                  {{.Content}}
          {{ end }}

No comments: