-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sitemap file name not changing when custom filename is specified #12525
Comments
This worked in v0.122.0 and earlier. When using a custom filename with a multilingual site, the sitemapindex links include the custom filename, but the files themselves do not, resulting in a broken sitemapindex. Failing test: func TestFoo(t *testing.T) {
t.Parallel()
files := `
-- hugo.toml --
baseURL = 'https://example.org/'
disableKinds = ['page','rss','section','taxonomy','term']
defaultContentLanguage = 'de'
defaultContentLanguageInSubdir = true
[languages.de]
[languages.en]
[sitemap]
filename = 'foo.xml'
-- layouts/index.html --
irrelevant
`
b := hugolib.Test(t, files)
b.AssertFileExists("public/de/foo.xml", true)
b.AssertFileExists("public/en/foo.xml", true)
b.AssertFileContent("public/foo.xml",
"<loc>https://example.org/de/foo.xml</loc>",
"<loc>https://example.org/en/foo.xml</loc>",
)
} |
Now it is working in the new version 0.126.2! Thank you @jmooring for the fix!! |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
If I am not doing anything wrong, it seems that the newer version is not generating a sitemap with a custom name. I have copied the configuration from the docs and changed the
filename
but it is always generating the sitemap with the defaultsitemap.xml
name.this is my config
and when I run
hugo
to build the site, the sitemap in thepublic
folder issitemap.xml
instead of thesitemap-1.xml
in the configuration.I know it was working in some versions ago, but I am not sure which one it was working. Also, I can be misconfiguring stuff, so I am sorry I am doing something wrong.
What version of Hugo are you using (
hugo version
)?hugo version
Does this issue reproduce with the latest release?
yes
Thank you for the great project! I love hugo <3
The text was updated successfully, but these errors were encountered: