Sitemaps and Hugo

Question about sitemaps.

I admit I’m a bit behind when it comes to staying on top of SEO, but I am bit confused on how Hugo handles sitemaps.

This is my sitemap:
https://thefreebundle.com/sitemap.xml
https://thefreebundle.com/index.xml

For some reason, I have those two files.

The Sitemap.xml appears to have a good collection of my pages. I’m trying to get my search results display the main sections of my website, like this:

Should I tweak my sitemap template to display only the main sections of my site or should I leave everything as it is and roll with it? I know that with wordpress you simply turn on Yoast and it happens almost automatically if not in a few days, but since Hugo handles things differently, I’m seeing different results than when my site was wordpress (eww) based.

Thanks!

The second link is actually your RSS feed. I also don’t see what Yoast can do that can’t be replicated here, the sitemap.xml can be customized to your needs.

1 Like

Dang, you are right, didn’t realized that.

Then again, I’m not sure if to have google show my main sections under the search results I have to edit my sitemap template or leave it as it is.

I know this is not a strictly hugo-related question, but I’m using Hugo so I’m trying to find an answer to it here.

Yeah, I guess this isn’t even related to sitemaps at all. Since one can’t simply tell Google what to do with the provided data. Maybe you should be looking for “structured data” (to increase your chances, I mean)? Anyway, good luck.

The image your posted of search results shows what are called sitelinks; you have no control over those; Google only gives them to sites they think are useful. Read https://support.google.com/webmasters/answer/47334?hl=en

1 Like

My bad. I was actually expecting something in this line:

https://yoast.com/sitemap_index.xml

The default xml sitemap we get with Hugo feels a bit… naked. I’m working on something to fix that, but I keep stumbling into this error:

Actually, found a way to make it pretty.

{{ printf "<?xml-stylesheet type=\"text/xsl\" href=\"https://raw.githubusercontent.com/pedroborges/xml-sitemap-stylesheet/master/sitemap.xsl\" ?>" | safeHTML }}

(That’s just a quick experiment)

I see. That’s useless for SEO.

Not only that, but you broke something (on Google Chrome, at least):

Unsafe attempt to load URL https://raw.githubusercontent.com/catcto/sitemap-stylesheet/master/sitemap.xsl from frame with URL https://thefreebundle.com/sitemap.xml. Domains, protocols and ports must match.

Again, there’s nothing wrong with the Hugo default sitemap.

1 Like

That was simply a test, an experiment. I uploaded the file to my site and works correctly. The error you see there was simply because I was linking a raw github file.

Yep, pretty useless for SEO, but looks nice.