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

Add an option to redirect trailing slash urls #74

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions src/writer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -237,13 +237,16 @@ function render(doc::Documenter.Document, settings::MarkdownVitepress=MarkdownVi
<a href="..$name">Redirecting to ..$name</a>
<meta http-equiv="refresh" content="0; URL=../$name">
<link rel="canonical" href="../$name">""")
# The script is equivalent to
# `<meta http-equiv="refresh" content="0; URL=../$name">`
# but keeps fragments. If Javascript fails for whatever
# reason, the meta http-equiv will proc, dropping fragments
# If that, too fails, there's an ordinary, human readable
# relative link.
#
# This uses a relative canonical link which is bad form, but
# oh well. We don't have access to the full URL until deploy
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may have access to the deploy URL through settings.deploy_url and deploy_decision, so in that situation we could add that in if it's better.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A recall trying that and finding that field to be empty.

# time.
#
# The script is equivalent to
# `<meta http-equiv="refresh" content="0; URL=../$name">`
# but keeps fragments
end
end
end
Expand Down
Loading