Hello
I’m new to Hugo but am a regular user of golang and its templating system, and have a nodding acquaintance with markdown.
I’m building a document site to support an app I wrote in go.
I’m using the hugo-book theme.
I’m up to the point where I can create posts, which are listed in the contents list in a kind of right sidebar
Each post has a title (obviously) and in some cases, it would be best if this title displayed an icon, instead of (or as well as) text.
So for example, mysite/content/docs/icons/bars/bars.md contains the following code:
title: "Bars"
weight: 1
image: "postbar.png"
# Navigation
A bar
![Bar](/bar.png)
This results in an entry called ‘Bars’ in the Table of Contents. Instead, I would like to display the icon itself, which is stored as postbar.png in what I hope is in the same leaf as buttons.md.
Is there an idiomatic way to do this (for example via the site or post settings) rather than editing the template files?
Couldn’t figure out how to flag as code so I followed the StackExchange convention i’m used to, which is to indent code blocks by four spaces. Thanks for the tip.
Thanks!
If someone can point me to any documentation or previous discussion on how to achieve this by editing templates that would be useful. As mentioned, though familiar with Golang templating, I’m on a steep learning curve as regards Hugo (though it’s clearly a great system and I found it very easy to get started)