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

Allow making non-native site links server-absolute #26

Merged
merged 2 commits into from
Aug 24, 2022

Conversation

QuLogic
Copy link
Member

@QuLogic QuLogic commented Feb 16, 2022

... instead of globally absolute with an explicit server name. This allows the docs to be served from a different server (e.g., on localhost), without links leaking out to the real matplotlib.org.

@jklymak
Copy link
Member

jklymak commented Feb 18, 2022

The top level won't resolve for the other websites that use the theme, though. Ie mpl-third-party etc?

@QuLogic
Copy link
Member Author

QuLogic commented Feb 23, 2022

Locally maybe, but not once on the site. They are all on the same server. Maybe we need an option as in matplotlib/mpl-brochure-site#41?

@QuLogic QuLogic changed the title Make non-native site links server-absolute Allow making non-native site links server-absolute Mar 2, 2022
@QuLogic
Copy link
Member Author

QuLogic commented Mar 2, 2022

OK, I modified the native_site option (which I never really understood the name of) into a navbar_links option, with 'absolute', 'relative', and 'internal' choices. This allows setting paths as https://matplotlib.org/..., /stable/..., or pathto('...'), and can be set by the theme config, or overridden by passing, e.g., -Dhtml_theme_options.navbar_links=internal.

@QuLogic
Copy link
Member Author

QuLogic commented May 28, 2022

Alternatively, perhaps this should be navbar_link_prefix, defaulting to https://matplotlib.org/stable/, can be overridden for the website with /stable, and setting None would mean fall back to pathto?

docs/conf.py Outdated
"native_site": False
# Determines the type of links produced in the navigation header:
# - absolute: Links point to the URL https://matplotlib.org/...
# - relative: Links point to top-level of the server /...
Copy link
Member

Choose a reason for hiding this comment

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

Discussed with Elliott on a a call, suggested this be rename to "server_stable" or something similar..

Copy link
Member Author

Choose a reason for hiding this comment

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

Done, and rebased.

... instead of globally absolute with an explicit server name. This
allows the docs to be served from a different server (e.g., on
localhost), without links leaking out to the real matplotlib.org.
docs/conf.py Outdated Show resolved Hide resolved
@tacaswell tacaswell merged commit 091def4 into matplotlib:main Aug 24, 2022
@QuLogic QuLogic deleted the server-absolutes branch August 24, 2022 21:10
QuLogic added a commit to QuLogic/matplotlib that referenced this pull request Aug 24, 2022
melissawm pushed a commit to melissawm/matplotlib that referenced this pull request Dec 19, 2022
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.

3 participants