diff --git a/doc/source/conf.py b/doc/source/conf.py index ea878f052f1f8..e8cd85e3369f7 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -225,11 +225,24 @@ # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. + +switcher_version = version +if ".dev" in version: + switcher_version = "dev" +elif "rc" in version: + switcher_version = version.split("rc")[0] + " (rc)" + html_theme_options = { "external_links": [], "github_url": "https://github.com/pandas-dev/pandas", "twitter_url": "https://twitter.com/pandas_dev", "google_analytics_id": "UA-27880019-2", + "navbar_end": ["version-switcher", "navbar-icon-links"], + "switcher": { + "json_url": "https://pandas.pydata.org/versions.json", + "url_template": "https://pandas.pydata.org/{version}/", + "version_match": switcher_version, + }, } # Add any paths that contain custom themes here, relative to this directory. diff --git a/web/pandas/versions.json b/web/pandas/versions.json new file mode 100644 index 0000000000000..76c06210e2238 --- /dev/null +++ b/web/pandas/versions.json @@ -0,0 +1,30 @@ +[ + { + "name": "dev", + "version": "docs/dev" + }, + { + "name": "1.4 (rc)", + "version": "pandas-docs/version/1.4" + }, + { + "name": "1.3 (stable)", + "version": "docs" + }, + { + "name": "1.3", + "version": "pandas-docs/version/1.3" + }, + { + "name": "1.2", + "version": "pandas-docs/version/1.2" + }, + { + "name": "1.1", + "version": "pandas-docs/version/1.1" + }, + { + "name": "1.0", + "version": "pandas-docs/version/1.0" + } +]