How to display a list of links to HTML pages


In my Jekyll site (github pages) I’d like to list links to all subpages in the site.
If I use {{ site.html_pages }} then I get the content of all the subpages, but that’s too much. I’d rather have a list of html links to these pages. Is there a way to produce this?

many thanks,


you can loop thru site.pages and site.posts (I think they are separate?). I do this for the sitemap.

Thanks @rdyar for the hint. Would you have some more details on how to write such a loop?

sure - here is one example of an xml sitemap - loops thru site.pages and then site.posts - not sure where collection would fall in that? but I’m sure they could be sorted out one way or another.

I also use exclude: true in the front matter of a page I don’t want in the sitemap - like an error page.

Thanks a lot @rdyar - with this I was able to build what I needed! :smiley: