<header><h1id="tag_Multiple Index Pages in Hugo">Multiple Index Pages in Hugo</h1></header>
<article>
<divstyle="text-align: center;">
<h2id="this-is-how-to-create-multiple-index-pages-in-hugo">This is how to create multiple index pages in Hugo <aclass="anchor"href="#this-is-how-to-create-multiple-index-pages-in-hugo">
<p>I wanted to order <ahref="/hackbook">Hackbook</a> in reverse (i.e. oldest to newest) so that it’s easier for the reader to start at the correct page.</p>
<p>I ran into the following problem - the default <strong><code>list.html</code></strong> does them from newest to oldest.</p>
<p>So I found <ahref="https://discourse.gohugo.io/t/two-home-pages/31312/9">this forum post</a> and I created a file in the <strong><code>_default</code></strong> directory as follows:</p>
</code></pre><h4id="if-you-want-to-display-the-date-on-the-left-of-the-titles-you-have-to-add-datesinlisttrue-in-your-configtoml-or-datesinlist-true-in-your-configyaml">if you want to display the date on the left of the titles, you have to add <strong><code>datesinlist=true</code></strong> in your config.toml or <strong><code>datesinlist: true</code></strong> in your config.yaml <aclass="anchor"href="#if-you-want-to-display-the-date-on-the-left-of-the-titles-you-have-to-add-datesinlisttrue-in-your-configtoml-or-datesinlist-true-in-your-configyaml">
<spanclass="spanForHeader">#</span>
</a></h4><h5id="you-probably-dont-need-enablegitinfo--true-as-that-will-crash-your-website-i-have-no-idea-what-it-does-you-dont-need-it">You probably don’t need <strong><code>enableGitInfo = true</code></strong> as that will crash your website, I have no idea what it does, you don’t need it. <aclass="anchor"href="#you-probably-dont-need-enablegitinfo--true-as-that-will-crash-your-website-i-have-no-idea-what-it-does-you-dont-need-it">
<spanclass="spanForHeader">#</span>
</a></h5><divstyle="text-align: center;">
<h2id="using-your-custom-_indexhtml">Using your custom _index.html <aclass="anchor"href="#using-your-custom-_indexhtml">
<p>After creating your custom _index.html you’d use it as follows:</p>
<ol>
<li>Create an _index.md file in your desired directory</li>
<li>Add <strong><code>layout: "hackbook/order-by-oldest"</code></strong> to your preamble (if you named your folder and or file something else, you have to change it here)</li>
<ahref="https://vodoraslo.xyz/">Homepage</a><br><br><ahref="/index.xml"><imgsrc="/rss.svg"style="max-height:1.5em"alt="RSS Feed"title="Subscribe via RSS for updates."></a>