<divclass="post-content"><h2id="this-is-how-to-create-multiple-index-pages-in-hugo">This is how to create multiple index pages in Hugo<ahiddenclass="anchor"aria-hidden="true"href="#this-is-how-to-create-multiple-index-pages-in-hugo">#</a></h2>
<p>I wanted to order <ahref="/library/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><p>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</p>
<p>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.</p>
<h2id="using-your-custom-_indexhtml">Using your custom _index.html<ahiddenclass="anchor"aria-hidden="true"href="#using-your-custom-_indexhtml">#</a></h2>
<p>After creating your custom _index.html you’d use it as follows:</p>
<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><divclass="rssSvg"><ahref="/index.xml"><imgsrc="/rss.svg"style="max-height:1.5em"alt="RSS Feed"title="Subscribe via RSS for updates."></a></div>