Skip to content

[DOC/WEB]: Resolving 'Getting started' URL ambiguity in pandas.io(Issue #32307) #39303

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

Closed
wants to merge 12 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 3 additions & 0 deletions doc/redirects.csv
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
whatsnew,whatsnew/index
release,whatsnew/index

# web
getting_started,docs/getting_started/index
Copy link
Member

Choose a reason for hiding this comment

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

Ah, hmm, now realizing this probably won't work for pages outside of /docs/. Any maintainers have thoughts about how to handle?

Copy link
Author

Choose a reason for hiding this comment

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

Thank you @afeld !!

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Author

Choose a reason for hiding this comment

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

Thank you @jreback

Copy link
Member

Choose a reason for hiding this comment

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

Indeed, this file is specifically for sphinx page (so under /docs in the url), and not for the website. So we will have to do something custom there if we want a redirect (I don't think there is a similar mechanism already).

In the end, for those redirects listed in this file, we create a small html page with the actual redirection. See

pandas/doc/make.py

Lines 211 to 220 in 097ff0c

<html>
<head>
<meta http-equiv="refresh" content="0;URL={row[1]}.html"/>
</head>
<body>
<p>
The page has been moved to <a href="{row[1]}.html">{title}</a>
</p>
</body>
<html>"""

So one option would be to include a single hardcoded html file for this specific redirect, or otherwise add something similar to https://github.com/pandas-dev/pandas/blob/master/web/pandas_web.py which generates the static web pages

Copy link
Author

@SouravPal1995 SouravPal1995 Jan 29, 2021

Choose a reason for hiding this comment

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

Should this aspect be dealt with in a separate PR? I am not sure what to do. Should I revert this specific change in the docs/redirects.csv? Or should I add the aforementioned pandas/doc/make.py?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, the change here in redirects.csv should be reverted

Copy link
Author

Choose a reason for hiding this comment

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

Okay... Thank you @jorisvandenbossche .. 😄 :

Copy link
Member

Choose a reason for hiding this comment

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

After removing the change in this file, let's add getting_started.html with a <meta> redirect to /docs/getting_started/index.html.


# getting started
install,getting_started/install
comparison_with_r,getting_started/comparison/comparison_with_r
Expand Down
2 changes: 1 addition & 1 deletion web/pandas/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ navbar:
- name: "Citing and logo"
target: /about/citing.html
- name: "Getting started"
target: /getting_started.html
target: /docs/getting_started/index.html
- name: "Documentation"
target: /docs/
- name: "Community"
Expand Down
57 changes: 0 additions & 57 deletions web/pandas/getting_started.md

This file was deleted.