Generating List of Pages
This post shows how to use jekyll to generate list of all pages in a website. I am using liquid templating engine to generate list of pages here. Pages are not posts, they are html file with front-matter.
PRINT LIST OF PAGES
To print latest pages sorted in reverse and not to print pages without title use following.
CODE:
<p><ul>
{% for ipage in site.pages reversed %}
<!-- guard against null pages -->
{% if ipage.title %}
{% if ipage.hidefromnav %}
<li><a style="color:red" href="{{ ipage.url }}"><strike>{{ ipage.title }}</strike></a></li>
{% else %}
<li><a style="color:green" href="{{ ipage.url }}">{{ ipage.title }}</a></li>
{% endif %}
{% endif %}
{% endfor %}
</ul></p>
OUTPUT:
Site map for robotsSearchNavigateSite AuthorsDPDemo-2DPDemo-1SuggestionsReadmeSubscribeLicenseDebugContact404: Page not found
Note: All pages are published in list above, RED pages are hidden from navigation.