Turning off taxonomy pages

@emarthinsen I think the confusion surround the use of “taxonomies” here. I also think I’m understanding what you mean by using the taxonomies “internally.”

In Hugo, taxonomy has a very specific meaning (ie, specific insomuch as it’s similar to the way Wordpress might leverage the idea as well). A taxonomy is a piece of front matter (ie, metadata) that has been identified to build key-value (ie, key list pages and value single pages) as part of your final output site. You can refer to the taxonomy overview to get a better idea of this.

Any front matter you put in your individual content (eg, /content/your-content-whatever.md) files can be accessed using your templating logic, but only those keys you set up as taxonomies are available to you when creating your list/single taxonomy pages. I think you’re just getting confused in the templating logic layer. E.g., lets say you have a piece of metadata in every .md file for author:.

title: My First Title  
date: 2016-02-08  
publishdate: 2016-02-09  
description: This is a description of my first page.
author: Jon Doe

If you wanted to access this page based on author, you could use {{ range where '.Param.author' 'Jon Doe'}}DO WHATEVER {{ end }}. This, however, only offers you the convenience of adding that templating in specific areas of your site (or partials).

However, let’s say you want to keep a list of all your authors and what each author has written. You might then have front matter as follows:

title: My Second Title
date: 2016-02-08
publishdate: 2016-02-09
description: This is a description of my second page, which has multiple authors.
authors: [Jane Doe, Jon Doe, Bill Bob]

You could then specify authors as a taxonomy in your config.toml file as follows:

[taxonomies]
    authors = "authors" 

Then in /layouts/taxonomy/author.html to show all the pieces written by an individual author:

<h1> Pieces Written By {{ .Title }}</h1>
<ul class="all-titles-by-specific-author">
  {{ range .Data.Pages }}
    <li>{{ .Title }}</li>
  {{ end }}
</ul>

Using the above example, yoursite/authors/jane-doe would then render as:

<h1>Pieces Written by Jane Doe</h1>
<ul class="all-titles-by-specific-author">
    <li>My Second Title</li>
</ul>

If you are not interested in creating any taxonomy pages, see the advice from @Skarlso above. You have to specifically set tag and category to no value since these are the only two taxonomies that are included with Hugo by default.

#config.toml
[taxonomies]
  tag = ""
  category = ""

Does that help?

3 Likes