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

Redirect pages: Add 404 pages #121137

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jkrumbiegel
Copy link
Contributor

@jkrumbiegel jkrumbiegel commented Dec 10, 2024

Adds a special error mode if the path matches the required format but the package is wrong:

grafik

And a generic 404 page otherwise

grafik

@DilumAluthge
Copy link
Member

I don't think all those links to search engines are necessary. I think the "no package exists" message is fine, and then maybe just a link to the JuliaLang.org homepage.

@DilumAluthge
Copy link
Member

And for the generic 404 page, maybe a link to the JuliaLang.org homepage would be nice.

@jkrumbiegel
Copy link
Contributor Author

I just implemented what @MasonProtter suggested as two other people also liked that, I have no strong preference regarding the exact content of the 404 pages

@DilumAluthge
Copy link
Member

Personally I think it's cleaner without the search engine links.

Either way, if we do have the search engine links, we should probably rel=nofollow them. And I think linking to the JuliaLang website is nice to do either way. We don't need to rel=nofollow the link to the JuliaLang website, because we do indeed endorse the JuliaLang website.

messageElement.innerHTML = `\
There is no package \${packageName} registered in the Julia General Registry.\
<br><br>\
Would you like to try searching <a href="https://github.com/search?q=\${packageName}.jl&type=repositories">Github</a>, \
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Would you like to try searching <a href="https://github.com/search?q=\${packageName}.jl&type=repositories">Github</a>, \
Would you like to try searching <a href="https://github.com/search?q=\${packageName}.jl&type=repositories">GitHub</a>, \

There is no package \${packageName} registered in the Julia General Registry.\
<br><br>\
Would you like to try searching <a href="https://github.com/search?q=\${packageName}.jl&type=repositories">Github</a>, \
<a href="https://about.gitlab.com/search/?searchText=\${packageName}.jl">Gitlab</a>, \
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
<a href="https://about.gitlab.com/search/?searchText=\${packageName}.jl">Gitlab</a>, \
<a href="https://about.gitlab.com/search/?searchText=\${packageName}.jl">GitLab</a>, \

const messageElement = document.querySelector(".centered-div p");
// Update the paragraph text
messageElement.innerHTML = `\
There is no package \${packageName} registered in the Julia General Registry.\
Copy link
Member

Choose a reason for hiding this comment

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

Would it be better to say Example.jl instead of just Example?

Suggested change
There is no package \${packageName} registered in the Julia General Registry.\
There is no package \${packageName}.jl registered in the Julia General Registry.\

@DilumAluthge
Copy link
Member

I thought about it a bit more. I think I'm fine with keeping the search engine links for now. We can re-evaluate and remove later if we change our minds.

@DilumAluthge
Copy link
Member

What does the user experience look like if they have JavaScript disabled or blocked?

@giordano
Copy link
Member

This PR reminded me that probably

should include also .github/workflows/redirects_page.yml and .ci/generate_redirects.jl

@MasonProtter
Copy link
Contributor

MasonProtter commented Dec 10, 2024

Personally, I think the search engine links are very helpful, because not all julia packages are registered, and this gives some helpful breadcrumbs for users to find non-registered packages if they're linked to them by the autolinkifier in Discourse and Zulip.

@DilumAluthge DilumAluthge changed the title Add 404 pages Redirect pages: Add 404 pages Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants