From 2955ebb03ef9546dc6a84a45b76a5971d0751f28 Mon Sep 17 00:00:00 2001 From: Revathy Venugopal <104772255+Revathyvenugopal162@users.noreply.github.com> Date: Fri, 16 Aug 2024 11:26:01 +0200 Subject: [PATCH] release: bump version 1.0.5 --- doc/changelog.d/469.fixed.md | 1 + doc/source/user-guide/configuration.rst | 14 ++++++++++++++ pyproject.toml | 2 +- src/ansys_sphinx_theme/__init__.py | 5 +++++ .../theme/ansys_sphinx_theme/theme.conf | 2 +- 5 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 doc/changelog.d/469.fixed.md diff --git a/doc/changelog.d/469.fixed.md b/doc/changelog.d/469.fixed.md new file mode 100644 index 00000000..0990e629 --- /dev/null +++ b/doc/changelog.d/469.fixed.md @@ -0,0 +1 @@ +feat: add default logo links for Ansys and PyAnsys logos \ No newline at end of file diff --git a/doc/source/user-guide/configuration.rst b/doc/source/user-guide/configuration.rst index a6552c28..497b0421 100644 --- a/doc/source/user-guide/configuration.rst +++ b/doc/source/user-guide/configuration.rst @@ -54,6 +54,20 @@ To use the logo in both dark and light modes, add the following code to the``htm "logo": "no_logo", } +.. note:: + + By default, if ``ansys`` logo is displayed, the logo links to the Ansys website. If the PyAnsys logo is displayed, the logo links to the PyAnsys website. + If you want to change the link, you can set the ``logo_link`` option in the ``conf.py`` file. + + For example: + + .. code-block:: python + + html_theme_options = { + "logo": "ansys", + "logo_link": "https://www.example.com", + } + .. note:: If you use the ``logo`` option, make sure to remove the ``html_logo`` option from the ``conf.py`` file. diff --git a/pyproject.toml b/pyproject.toml index c9aac408..703dcb10 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "flit_core.buildapi" [project] # Check https://flit.readthedocs.io/en/latest/pyproject_toml.html for all available sections name = "ansys-sphinx-theme" -version = "1.0.4" +version = "1.0.5" description = "A theme devised by ANSYS, Inc. for Sphinx documentation." readme = "README.rst" requires-python = ">=3.9,<4" diff --git a/src/ansys_sphinx_theme/__init__.py b/src/ansys_sphinx_theme/__init__.py index e6ae75e5..745f9fbc 100644 --- a/src/ansys_sphinx_theme/__init__.py +++ b/src/ansys_sphinx_theme/__init__.py @@ -54,6 +54,9 @@ JS_FILE = JS_PATH / "table.js" LOGOS_PATH = STATIC_PATH / "logos" +ANSYS_LOGO_LINK = "https://www.ansys.com/" +PYANSYS_LOGO_LINK = "https://docs.pyansys.com/" + # make logo paths available ansys_favicon = str((LOGOS_PATH / "ansys-favicon.png").absolute()) ansys_logo_black = str((LOGOS_PATH / "ansys_logo_black_cropped.jpg").absolute()) @@ -377,8 +380,10 @@ def configure_theme_logo(app: Sphinx): if logo_option == "ansys": theme_options["logo"] = ansys_logo + theme_options["logo_link"] = theme_options.get("logo_link", ANSYS_LOGO_LINK) elif logo_option == "pyansys": theme_options["logo"] = pyansys_logo + theme_options["logo_link"] = theme_options.get("logo_link", PYANSYS_LOGO_LINK) elif logo_option == "no_logo": theme_options["logo"] = None diff --git a/src/ansys_sphinx_theme/theme/ansys_sphinx_theme/theme.conf b/src/ansys_sphinx_theme/theme/ansys_sphinx_theme/theme.conf index d05d936b..f5a2cefa 100644 --- a/src/ansys_sphinx_theme/theme/ansys_sphinx_theme/theme.conf +++ b/src/ansys_sphinx_theme/theme/ansys_sphinx_theme/theme.conf @@ -4,7 +4,7 @@ inherit = pydata_sphinx_theme [options] contact_mail = github_url = https://github.com/ansys -logo.link = https://www.ansys.com/ +logo_link = show_breadcrumbs = True show_icons = True hidden_icons =