Hugo logo functionality

In config.toml the basic:

[params]
logo = “xxx.png”

works but with limitations:
-shown with a hard-coded width
-no control over alt text
-no screentip (title) text

I then tried:

[params.logo]
url = “logo.png”
alt = “alt text”
width = “W”
height = “L”

which does not work (logo not shown). Eventually I was able to get the functionality we need by creating a logo.html in layout/partials and modifying baseof.html to include logo.html. To get desired dimensions, I used inline style attributes to override containing class attributes, and the end result is good.

My questions is whether this approach is acceptable ? Is there a better way ? Is there another set of fields in config.toml I should be using ? Thanks

This is completely up to the theme you are using.

1 Like

Fredrik … ok thanks. Upon more investigation I think the cleaner way is to modify the navigation.html file that came with the particular theme we’re using (“dot”). That file references the logo parameter and creates the logo <img> tag, so I added references to logo_width, logo_height, logo_screentip, etc and then defined those in config.toml

This works fine, can be expanded further if needed, and seems to be the minimum possible mods to the theme.