Overwrite Default Landing Page For Hugo Taxonomies

“Overwriting default landing page for Hugo taxonomies”. What do I mean by that? By default, Hugo will create a home page or a landing page for your taxonomies. /tags/ or /categories are good examples. If you don’t have any specific templates for tags /layouts/tags/list.html Hugo will use the default one /layouts/_default/list.html and create an index.html for tags implicitly. If you want to change the front-matter for that index page or add some content to it for some reason, you need to create the index page yourself. Now, Hugo will use the file you’ve created.

In my site, I wanted to change “tags” to “archives”. To do that, I’ve created a new file /content/tags/_index.md and changed set a new title property in it’s front-matter. By the way, it doesn’t have to be a taxonomy page. This is also valid for any other section under /contents. We don’t have to create an index page for each section but we can create one if we want to overwrite defaults and add something special for that section. For more see related docs Taxonomies, Content Organization

Next Episode

published on 05.08.2020

This post will be very short and precise. In Jekyll, we had to create an .xml file using liquid templates to tell Jekyll that we want an rss.xml or similarly sitemap.xml. Luckily, Hugo creates these files for us under the hood. You can check them by going to /index.xml and /sitemap.xml pages in your …

Previous Episode

published on 03.08.2020

In this post, I aim to explain this website. Template by template… The main purpose here is to create a document to myself for future reference. Templates are complicated and not easy to read. That’s why I’ll probably forget what I did and why I coded this way. […] We are …

TAG CLOUD