diff --git a/CHANGES.rst b/CHANGES.rst index 0909d4f2e3..c5f3bef7db 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -4,7 +4,7 @@ Changelog ********* Changelog entries for the development version are available at -https://hyperspy.readthedocs.io/en/latest/user_guide/changes.html +https://hyperspy.readthedocs.io/en/latest/changes.html .. towncrier-draft-entries:: |release| [UNRELEASED] diff --git a/doc/_static/switcher.json b/doc/_static/switcher.json index 2a696355bb..26da48c9cb 100644 --- a/doc/_static/switcher.json +++ b/doc/_static/switcher.json @@ -1,13 +1,17 @@ [ { - "name": "v2.0 (dev)", - "version": "2.0", + "name": "dev", + "version": "dev", "url": "https://hyperspy.org/hyperspy-doc/dev/" }, { - "version": "1.7", + "version": "2.0", "url": "https://hyperspy.org/hyperspy-doc/current/" }, + { + "version": "1.7", + "url": "https://hyperspy.org/hyperspy-doc/v1.7/" + }, { "version": "1.6", "url": "https://hyperspy.org/hyperspy-doc/v1.6/" diff --git a/doc/conf.py b/doc/conf.py index 4958880d2c..865fbffd70 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -161,6 +161,15 @@ favicons = ["hyperspy.ico", ] +# For version switcher: +# For development, we match to the dev version in `switcher.json` +# for release version, we match to the minor increment +import hyperspy +_version = hyperspy.__version__ +version_match = "dev" if "dev" in _version else ".".join(_version.split(".")[:2]) + +print("version_match:", version_match) + html_theme_options = { "show_toc_level": 2, "github_url": "https://github.com/hyperspy/hyperspy", @@ -190,7 +199,7 @@ "switcher": { # Update when merged and released "json_url": "https://hyperspy.org/hyperspy-doc/dev/_static/switcher.json", - "version_match": version, + "version_match": version_match, }, "navbar_start": ["navbar-logo", "version-switcher"], "announcement": "HyperSpy API is changing in version 2.0, see the release notes!", diff --git a/upcoming_changes/3291.maintenance.rst b/upcoming_changes/3291.maintenance.rst new file mode 100644 index 0000000000..a278dd8831 --- /dev/null +++ b/upcoming_changes/3291.maintenance.rst @@ -0,0 +1 @@ +Update version switcher. \ No newline at end of file