Skip to content
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

wrong sitemap for 404.html #1011

Closed
fkastner opened this issue Apr 23, 2023 · 2 comments · Fixed by #1024 or #1026
Closed

wrong sitemap for 404.html #1011

fkastner opened this issue Apr 23, 2023 · 2 comments · Fixed by #1024 or #1026

Comments

@fkastner
Copy link
Contributor

Another sitemap issue:
the 404.html appears as <loc>https://tlienart.github.io/FranklinTemplates.jl/404/index.html</loc>.
I think this is because the file is special cased in form_output_path

function form_output_path(base::AS, file::AS, case::Symbol)
# .md -> .html for md pages:
case == :md && (file = change_ext(file))
outbase = _out_path(base)
if case in (:md, :html)
# file is index.html or 404.html or in keep_path --> keep the path
# file is page.html --> .../page/index.html
fname = splitext(file)[1]
if fname ("index", "404") && !endswith(fname, "/index") && !_keep_path(base, fname)
file = joinpath(fname, "index.html")
end
end
outpath = joinpath(outbase, file)
outdir = splitdir(outpath)[1]
isdir(outdir) || mkpath(outdir)
return outpath
end

and the sitemap generator does not know about this.

I think the most elegant way to handle this would probably be to add the file to keep_path instead of the current special handling. But that would be a breaking change.

tlienart added a commit that referenced this issue Apr 27, 2023
tlienart added a commit that referenced this issue Apr 27, 2023
* closes #1011

* correct approach so that users redefining keep path don't have to add 404
@fkastner
Copy link
Contributor Author

Actually the issue still persists for 404.md pages (as in some of the templates).
Do you think your fix can be adapted to handle those as well?

@tlienart
Copy link
Owner

🤔 crap that shouldn't have happened. Thanks for the report, I'll look into it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants