Custom Robots.txt and sitemap.xml Templates

#21

Hi - that was confusing. I rewrote it. It can be any page you want to exclude. Once you add the param, it should show up in the robots.txt.

Regarding the other question, could you make a new post please. From what you pasted it is hard to tell, and I want to ask if you could please have a look at Requesting Help and provide some more details, in the new post? Thanks.

0 Likes

#22

@RickCogley
Loving your code, thanks.

I noticed an issue: Multilingual pages, like example.ru.md, do not get added to robots.txt.

I have enableRobotsTXT = "true" in front matter of both files example.md and example.ru.md.

I expect to get two entries in robots.txt:


/example/
/ru/example/

But I only get one /example/

What do you this is a problem?

0 Likes

#23

Hmm, I imagine it is something with the range statement. I don’t have time to set up a test but, can you try {{ .Permalink }} instead? Or, maybe it needs absLangURL.

1 Like

#24

Thanks, will give it a try later.

0 Likes