Create discussion for dummies

Hi there,

Me like many others in these discussions find ourself lost in the terms and naming Hugo use.

I was searching and trying different methods to make a simple thing like showing some text under the menu name

as I was trying to add

  • title:
  • description:
  • decText:

in config file all were giving error can't evaluate field slognText in type *navigation.MenuEntry

and after reading many blogs and discussions I now use pre: and it works but there is no way a beginner like me will ever search for “Hugo pre” when trying to show menu item slogan

is it possible we can create level based discussions for beginners and a list of things which one can search without knowing the exact names like .pre in Hugo.

Right now I feel the info need is really hard to find.

Thanks

I will search the menu, and then I get

an example like below

https://github.com/CarsonSlovoka/gohugo-theme-ananke/blob/adeb59e/layouts/partials/site-navigation.html#L27-L34

With .Site, you can get to the contents of the config, the actual effect depends on the template you use, that is, if you use the theme, not implement the .Pre, then even if the config you set, it will not have results.

I would recommend learning a little Go, understanding the text/template or html/template. Then, if you still want to use the Hugo to help you build a static site, you will better understand many things and rely on the documentation; you will be very pained!

1 Like

Hi @Carson,

I post in the category meta as a suggestion and not something very specific to me. As I am learning Hugo the hard way :slight_smile:

The word pre: is used 3 times on the page you shared but no where it explain what the pre: is, it is expecting me to understand the use of pre just by looking at pre: <i class='fa fa-heart'></I> which to me looks like a method on how to use an icon in menu.

isn’t the purpose of good documentation to provide answers on how to make use of the tool/product? so, this was just a suggestion on how to improve.

thanks for taking the time

Pre is documented here: Menu Entry Properties | Hugo for anyone after this.

Documentation comes up repeatedly and while I agree that is a great suggestion to have tutorials and what not for beginners, it is about resources of which there are limited and requests of which there are many.

Here is MenuEntry that you can set on your menu or front matter

https://github.com/gohugoio/hugo/blob/e3dc5240f01fd5ec67643e40f27c026d707da110/navigation/menu.go#L33-L49

If you want to customize by yourself, you may consider using the Params

Here is an example

output:

run by yourself

git clone https://github.com/CarsonSlovoka/old-home.git
cd old-home
git fetch origin dev
git checkout aa5a9b0632b4b09d85adf52ca85cf801efa44428
git submodule update --init
hugo

Hugo has helped us think through many scenarios, but because of this, you may have to try to understand the documentation. Even if you want to look at the source code, I don’t think it’s suitable for beginners at this stage, and you can certainly go up from the first version, but it’s tiring to do so without guidance.

Hugo wants to give us is a macro concept. It tells us a static site has those things to consider. You can touch the framework and learn its spirit, but if you want to be entirely led by the framework, I think it’s very tiring!

1 Like

hi @tracykev

thanks for sharing the link, I myself found this but it was not easy to find. the most difficult part is to find out what pre:

and once you go to this page Menu entry variables | Hugo

This is the language you need to make sense of, as this text is not easy to understand. There appears to be a grammatical panic on the first line.

.Pre

template.HTML Value of the pre key if set for the menu entry. This value typically contains a string representing HTML.

So documentation for dummies/beginners can make use of simple English, otherwise at least correct grammar so one can read properly.

thanks