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

WEB: Unpin pydata sphinx theme #48285

Merged
merged 11 commits into from Sep 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions doc/_templates/sidebar-nav-bs.html
@@ -1,9 +1,9 @@
<nav class="bd-links" id="bd-docs-nav" aria-label="Main navigation">
<div class="bd-toc-item active">
{% if pagename.startswith("reference") %}
{{ generate_nav_html("sidebar", maxdepth=4, collapse=True, includehidden=True, titles_only=True) }}
{{ generate_toctree_html("sidebar", maxdepth=4, collapse=True, includehidden=True, titles_only=True) }}
{% else %}
{{ generate_nav_html("sidebar", maxdepth=4, collapse=False, includehidden=True, titles_only=True) }}
{{ generate_toctree_html("sidebar", maxdepth=4, collapse=False, includehidden=True, titles_only=True) }}
{% endif %}
</div>
</nav>
4 changes: 2 additions & 2 deletions doc/source/conf.py
Expand Up @@ -242,10 +242,10 @@
"github_url": "https://github.com/pandas-dev/pandas",
"twitter_url": "https://twitter.com/pandas_dev",
"google_analytics_id": "UA-27880019-2",
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
"google_analytics_id": "UA-27880019-2",
"google_analytics_id": "UA-27880019-2",
"logo": {"image_dark": "../../web/pandas/static/img/pandas_white.svg"},

I think this should add the logo for the dark site: https://pydata-sphinx-theme.readthedocs.io/en/stable/user_guide/branding.html#different-logos-for-light-and-dark-mode

Copy link
Member Author

Choose a reason for hiding this comment

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

Thx, I was checking https://pydata-sphinx-theme.readthedocs.io/en/stable/user_guide/light-dark.html

Will build docs locally to check

Copy link
Member Author

Choose a reason for hiding this comment

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

So this did not work. This path goes to _static. Tried to add the relative path from static to our svg, but this did not work either. So copied it over. Maybe you have a better solution?

Copy link
Member

Choose a reason for hiding this comment

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

It's strange, I used the same as for the regular logo, I assumed it'd work in the same way. But I guess the original logo code is implemented by Sphinx, and the dark by the theme, so they may have differences.

Not ideal, but did you try to use the full https://pandas.pydata.org/... Path? If it works probably better than copying the image.

I'm in my phone now, I can have a look and see if looking at the theme code I can find a better solution. But I'm ok to have a copy of the logo if it's the only thing that works for now.

Copy link
Member Author

Choose a reason for hiding this comment

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

We have to give a relative path from the _static folder and this did not work. I think we don't want to load this from the web?

Copy link
Member

Choose a reason for hiding this comment

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

I see, I didn't understand well before, sorry. I see what you mean here: https://github.com/pydata/pydata-sphinx-theme/blob/v0.10.1/src/pydata_sphinx_theme/theme/pydata_sphinx_theme/components/navbar-logo.html#L16

My preference would be to load the image from the web actually. Given the options, simply using https://pandas.pydata.org/static/img/pandas_white.svg seems like the simplest option.

Copy link
Member Author

Choose a reason for hiding this comment

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

Seems that this works

"logo": {"image_dark": "https://pandas.pydata.org/static/img/pandas_white.svg"},
"navbar_end": ["version-switcher", "navbar-icon-links"],
"switcher": {
"json_url": "https://pandas.pydata.org/versions.json",
"url_template": "https://pandas.pydata.org/{version}/",
"json_url": "/versions.json",
"version_match": switcher_version,
},
}
Expand Down
2 changes: 1 addition & 1 deletion environment.yml
Expand Up @@ -100,7 +100,7 @@ dependencies:
- natsort # DataFrame.sort_values doctest
- numpydoc
- pandas-dev-flaker=0.5.0
- pydata-sphinx-theme=0.8.0
- pydata-sphinx-theme
- pytest-cython # doctest
- sphinx
- sphinx-panels
Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.txt
Expand Up @@ -77,7 +77,7 @@ gitdb
natsort
numpydoc
pandas-dev-flaker==0.5.0
pydata-sphinx-theme==0.8.0
pydata-sphinx-theme
pytest-cython
sphinx
sphinx-panels
Expand Down
21 changes: 14 additions & 7 deletions web/pandas/versions.json
@@ -1,30 +1,37 @@
[
{
"name": "dev",
"version": "docs/dev"
"version": "dev",
"url": "/docs/dev/"
},
{
"name": "1.4 (stable)",
"version": "docs"
"version": "1.4 (stable)",
"url": "/docs/"
},
{
"name": "1.4",
"version": "pandas-docs/version/1.4"
"version": "1.4",
"url": "/pandas-docs/version/1.4/"
},
{
"name": "1.3",
"version": "pandas-docs/version/1.3"
"version": "1.3",
"url": "/pandas-docs/version/1.3/"
},
{
"name": "1.2",
"version": "pandas-docs/version/1.2"
"version": "1.2",
"url": "/pandas-docs/version/1.2/"
},
{
"name": "1.1",
"version": "pandas-docs/version/1.1"
"version": "1.1",
"url": "/pandas-docs/version/1.1/"
},
{
"name": "1.0",
"version": "pandas-docs/version/1.0"
"version": "1.0",
"url": "/pandas-docs/version/1.0/"
}
]