<li><ahref="#this-is-how-to-create-multiple-index-pages-in-hugo">This is how to create multiple index pages in Hugo</a></li>
<li><ahref="#using-your-custom-_indexhtml">Using your custom _index.html</a></li>
</ul>
</nav>
<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 <code>list.html</code> 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 <code>_default</code> directory as follows:</p>
<p>If you want to display the date on the left of the titles, you have to add <code>datesinlist=true</code> in your config.toml or <code>datesinlist: true</code> in your config.yaml</p>
<p>You probably don’t need <code>enableGitInfo = true</code> 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>
<ol>
<li>Create an _index.md file in your desired directory</li>
<li>Add <code>layout: "hackbook/order-by-oldest"</code> to your preamble (if you named your folder and or file something else, you have to change it here)</li>
</ol>
<figure><imgsrc="/img/layout-custom-index.PNG"alt="Picture of the layout in the preamble"></figure>
<p>And now you should have a custom _index.html for your pages! :)</p>
<p>Here is a verbose copy paste of the original hugo forum answer in case it gets deleted:</p>
<divstyle="padding-bottom: 0.7em; padding-top: 1em;"class="index-links"><ahref="https://vodoraslo.xyz/">Homepage</a></div><div><ahref="/index.xml"><imgsrc="/rss.svg"style="max-height:1.5em"alt="RSS Feed"title="Subscribe via RSS for updates."></a></div>