Cross reference link

I am using the Crisp template and would like to implement a standalone page listing the categories of blog posts. I don’t quite understand the cross-referencing involved to make the link though.

I have placed the markdown file here content/categories/categories.md and try to link to it in a partial (navigation.html) called from the header.

Reading the docs on Cross-referencing I gather I should do something like this:

<h6><a href="{{< relref "categories/categories.md" >}}">Categories</a></h6>

however this fails and none of the navigation.html partial is implemented. I also tried an absolute reference and also this:

<h6><a href="{{ $baseurl }}categories/categories.md">Categories</a></h6>

I’m sure I’m missing something simple. Can someone point me in the right direction.

I’m not sure what you’re looking for, but you find it if you look for Taxonomies in the documentation:

As I understand it Taxonomies are used to group similar or related pieces of content. Hugo offers the functionality to list all pieces of content associated with the taxonomy or all taxonomic terms. Great.

This is NOT what i’m looking for. Although it is related and the use of the word categories may have caused confusion.

I am trying to create a page which explains the groupings (or Taxonomies) on my site, this is what categories.md is. To use the example in the docs, if I have an actor taxonomy with the following tags “1970’s Actor”, “1980’s Actor”, “1990’s Actor”, … I want a page something like this:

Tags in the Actor taxonomy:
1970’s Actor - This film stars actors who began working in the 1970s
1980’s Actor - This film stars actors who began working in the 1980s
1990’s Actor - This film stars actors who began working in the 1990s

My problem is linking to such a page, which is standalone, from the homepage.

From shortcodes:

Note that shortcodes will not work in template files—if you need a functionality like that in a template, you most likely want a partial template instead.

If you are trying to put it on your homepage you are probably looking at menus. However, it is this whole other thing, for creating related/nested menus and stuff, and you might just be better off linking to the URL you know it will create, like so:

<h6><a href="/categories/categories/">Categories</a></h6>

1 Like

Thanks Bjørn and maiki. As its a one off I went the simplest way and linked directly to the URL.