Hugo not injecting .Hugo.Generator

Hi! :slight_smile: I noticed that hugo isn’t injecting .Hugo.Generator in the homepage of a site I’m working on. The only difference to my other sites is that I’m using layouts/_defaoult/baseof.html.

Is this the expected behavior? Thanks!

We inject it if we find a head tag. You can use the {{ hugo.Generator }} directly in your templates to make sure it gets there … Which is appreciated.

Just to let you know, I found the issue. The head tag wasn’t found because I misplaced the lang attribute: <head lang="{{ .Site.Language.Lang }}">. Removing it makes the generator tag to appear.

Of course! That was the motivation of my question in the first place. I wanted that tag in the site! :slight_smile:

1 Like

We have made many mistakes developing Hugo (and many smart one), but injecting the Hugo generator tag gives us a pretty good presence here:

https://trends.builtwith.com/cms/Hugo

1 Like