From e66528f887896157a52c371539520f43c01218eb Mon Sep 17 00:00:00 2001 From: Revathy Venugopal <104772255+Revathyvenugopal162@users.noreply.github.com> Date: Mon, 8 May 2023 14:56:31 +0200 Subject: [PATCH] VER: bump version 0.9.9 --- .github/workflows/ci_cd.yml | 3 +- doc/source/conf.py | 7 +- src/ansys_sphinx_theme/__init__.py | 2 +- .../components/search-field.html | 47 ++++++------ .../theme/ansys_sphinx_theme/search.html | 72 +++++++++++++++++++ 5 files changed, 102 insertions(+), 29 deletions(-) create mode 100644 src/ansys_sphinx_theme/theme/ansys_sphinx_theme/search.html diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index 5618bd6f1..e0ee3b250 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -13,6 +13,7 @@ env: PACKAGE_NAME: 'ansys-sphinx-theme' PACKAGE_NAMESPACE: 'ansys_sphinx_theme' DOCUMENTATION_CNAME: 'sphinxdocs.ansys.com' + MEILISEARCH_API_KEY: ${{ secrets.MEILISEARCH_API_KEY }} concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -50,7 +51,7 @@ jobs: doc-deploy-development: name: Doc dev version deploy - if: ${{ github.ref == 'refs/heads/main' }} + # if: ${{ github.ref == 'refs/heads/main' }} runs-on: ubuntu-latest needs: build-library steps: diff --git a/doc/source/conf.py b/doc/source/conf.py index 58e214c66..3e30d6750 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -65,9 +65,10 @@ "version_match": get_version_match(__version__), }, "use_meilisearch": { + "api_key": os.getenv("MEILISEARCH_API_KEY", ""), "index_uids": { - "ansys-ansys-sphinx-theme-sphinx-docs": "ansys-sphinx-theme", - "pyansys-docs-all-public": "PyAnsys", + "ansys-internal-ansys-sphinx-theme-sphinx-docs": "ansys-sphinx-theme", + "pyansys-pyaedt-sphinx-docs": "PyAEDT", }, }, } @@ -88,7 +89,7 @@ # Intersphinx mapping intersphinx_mapping = { - "python": ("https://docs.python.org/dev", None), + "python": ("https://docs.python.org/3", None), # kept here as an example # "scipy": ("https://docs.scipy.org/doc/scipy/reference", None), # "numpy": ("https://numpy.org/devdocs", None), diff --git a/src/ansys_sphinx_theme/__init__.py b/src/ansys_sphinx_theme/__init__.py index a12f96b1b..a11f9af60 100644 --- a/src/ansys_sphinx_theme/__init__.py +++ b/src/ansys_sphinx_theme/__init__.py @@ -7,7 +7,7 @@ from ansys_sphinx_theme.latex import generate_404 # noqa: F401 -__version__ = "0.9.8" +__version__ = "0.9.9" # Declare the fundamental paths of the theme THIS_PATH = pathlib.Path(__file__).parent.resolve() diff --git a/src/ansys_sphinx_theme/theme/ansys_sphinx_theme/components/search-field.html b/src/ansys_sphinx_theme/theme/ansys_sphinx_theme/components/search-field.html index 92e940244..0419e3d5e 100644 --- a/src/ansys_sphinx_theme/theme/ansys_sphinx_theme/components/search-field.html +++ b/src/ansys_sphinx_theme/theme/ansys_sphinx_theme/components/search-field.html @@ -1,5 +1,6 @@ {% if theme_use_meilisearch %} + {% set API_KEY = theme_use_meilisearch.api_key %} @@ -8,47 +9,45 @@ {% if theme_use_meilisearch.index_uids %} - - {% endif %} + + {% endif %} + + {% if not theme_use_meilisearch.host %} + {% set HOST_URL = "https://backend.search.pyansys.com/" %} + {% else %} + {% set HOST_URL = theme_use_meilisearch.host %} + {% endif %} - - {% if not theme_use_meilisearch.host and not theme_use_meilisearch.api_key %} - {% set HOST_URL = "https://search.pyansys.com" %} - {% set API_KEY = "A1Qxly2sls6g1rb1sIKEVEtE7R1UsHad0VgqnvKhD5nhBNf5de" %} - {% else %} - {% set HOST_URL = theme_use_meilisearch.host %} - {% set API_KEY = theme_use_meilisearch.api_key %} - {% endif %} {% else %} - {%- extends "pydata_sphinx_theme/components/search-field.html" -%} + {%- include "pydata_sphinx_theme/components/search-field.html" -%} {% endif %} diff --git a/src/ansys_sphinx_theme/theme/ansys_sphinx_theme/search.html b/src/ansys_sphinx_theme/theme/ansys_sphinx_theme/search.html new file mode 100644 index 000000000..a24fd994a --- /dev/null +++ b/src/ansys_sphinx_theme/theme/ansys_sphinx_theme/search.html @@ -0,0 +1,72 @@ +{% if theme_use_meilisearch %} + {%- extends "page.html" %} + {%- block content %} + {# checkbox to toggle primary sidebar #} + + + {# Checkboxes to toggle the secondary sidebar #} + + + {%- if theme_announcement -%} + {% include "sections/announcement.html" %} + {%- endif %} + {% block docs_navbar %} + + {% endblock docs_navbar %} +