Skip to content

Commit e66528f

Browse files
VER: bump version 0.9.9
1 parent 56d2678 commit e66528f

File tree

5 files changed

+102
-29
lines changed

5 files changed

+102
-29
lines changed

.github/workflows/ci_cd.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ env:
1313
PACKAGE_NAME: 'ansys-sphinx-theme'
1414
PACKAGE_NAMESPACE: 'ansys_sphinx_theme'
1515
DOCUMENTATION_CNAME: 'sphinxdocs.ansys.com'
16+
MEILISEARCH_API_KEY: ${{ secrets.MEILISEARCH_API_KEY }}
1617

1718
concurrency:
1819
group: ${{ github.workflow }}-${{ github.ref }}
@@ -50,7 +51,7 @@ jobs:
5051

5152
doc-deploy-development:
5253
name: Doc dev version deploy
53-
if: ${{ github.ref == 'refs/heads/main' }}
54+
# if: ${{ github.ref == 'refs/heads/main' }}
5455
runs-on: ubuntu-latest
5556
needs: build-library
5657
steps:

doc/source/conf.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,10 @@
6565
"version_match": get_version_match(__version__),
6666
},
6767
"use_meilisearch": {
68+
"api_key": os.getenv("MEILISEARCH_API_KEY", ""),
6869
"index_uids": {
69-
"ansys-ansys-sphinx-theme-sphinx-docs": "ansys-sphinx-theme",
70-
"pyansys-docs-all-public": "PyAnsys",
70+
"ansys-internal-ansys-sphinx-theme-sphinx-docs": "ansys-sphinx-theme",
71+
"pyansys-pyaedt-sphinx-docs": "PyAEDT",
7172
},
7273
},
7374
}
@@ -88,7 +89,7 @@
8889

8990
# Intersphinx mapping
9091
intersphinx_mapping = {
91-
"python": ("https://docs.python.org/dev", None),
92+
"python": ("https://docs.python.org/3", None),
9293
# kept here as an example
9394
# "scipy": ("https://docs.scipy.org/doc/scipy/reference", None),
9495
# "numpy": ("https://numpy.org/devdocs", None),

src/ansys_sphinx_theme/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
from ansys_sphinx_theme.latex import generate_404 # noqa: F401
99

10-
__version__ = "0.9.8"
10+
__version__ = "0.9.9"
1111

1212
# Declare the fundamental paths of the theme
1313
THIS_PATH = pathlib.Path(__file__).parent.resolve()
Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<!-- Debugging: html_theme_options = {{ html_theme_options }} -->
22
{% if theme_use_meilisearch %}
3+
{% set API_KEY = theme_use_meilisearch.api_key %}
34
<!-- Include the MeiliSearch CSS stylesheet only if theme present -->
45
<link href="{{ pathto('_static/css/meilisearch.css', 1) }}" rel="stylesheet">
56

@@ -8,47 +9,45 @@
89
<input type="search" placeholder="Search" class="form-control" id="search-bar-input" autofocus />
910

1011
{% if theme_use_meilisearch.index_uids %}
11-
<select id="indexUidSelector" class="index-select">
12-
{% for index_uid, index_name in theme_use_meilisearch.index_uids.items() %}
13-
<option value="{{ index_uid }}">{{ index_name }}</option>
14-
{% endfor %}
15-
</select>
16-
{% endif %}
12+
<select id="indexUidSelector" class="index-select">
13+
{% for index_uid, index_name in theme_use_meilisearch.index_uids.items() %}
14+
<option value="{{ index_uid }}">{{ index_name }}</option>
15+
{% endfor %}
16+
</select>
17+
{% endif %}
1718
<i class="fa-solid fa-magnifying-glass"></i>
1819
<!-- Include the MeiliSearch JavaScript library for the search bar -->
1920
<script src="https://cdn.jsdelivr.net/npm/docs-searchbar.js@latest/dist/cdn/docs-searchbar.min.js"></script>
21+
22+
{% if not theme_use_meilisearch.host %}
23+
{% set HOST_URL = "https://backend.search.pyansys.com/" %}
24+
{% else %}
25+
{% set HOST_URL = theme_use_meilisearch.host %}
26+
{% endif %}
2027

21-
<!-- If no credentials provided, use the default ones -->
22-
{% if not theme_use_meilisearch.host and not theme_use_meilisearch.api_key %}
23-
{% set HOST_URL = "https://search.pyansys.com" %}
24-
{% set API_KEY = "A1Qxly2sls6g1rb1sIKEVEtE7R1UsHad0VgqnvKhD5nhBNf5de" %}
25-
{% else %}
26-
{% set HOST_URL = theme_use_meilisearch.host %}
27-
{% set API_KEY = theme_use_meilisearch.api_key %}
28-
{% endif %}
2928
<script>
3029
// Initialize the MeiliSearch bar with the given API key and host
3130
// inspect the first value of index UID as default
32-
let theSearchBar = docsSearchBar({
33-
hostUrl: "{{ HOST_URL }}",
34-
apiKey: "{{ API_KEY }}",
35-
indexUid: "{{ theme_use_meilisearch.index_uids.items()|first|first }}",
36-
inputSelector: '#search-bar-input, #indexUidSelector',
37-
enableDarkMode: 'auto',
38-
debug: true // Set debug to true if you want to inspect the dropdown
31+
var theSearchBar = docsSearchBar({
32+
hostUrl: "{{ HOST_URL }}",
33+
apiKey: "{{ API_KEY }}",
34+
indexUid: "{{ theme_use_meilisearch.index_uids.items()|first|first }}",
35+
inputSelector: '#search-bar-input',
36+
enableDarkMode: 'auto',
37+
debug: true // Set debug to true if you want to inspect the dropdown
3938
});
4039

4140
document.getElementById('indexUidSelector').addEventListener('change', function() {
4241
theSearchBar.indexUid = this.value;
43-
theSearchBar.inputSelector = '#docs-searchbar-suggestion';
42+
theSearchBar.inputSelector = '#search-bar-input';
4443
});
4544

4645
// Set the focus on the search bar input
47-
document.getElementById('docs-searchbar-suggestion').focus();
46+
document.getElementById('search-bar-input').focus();
4847
</script>
4948
</form>
5049
{% else %}
5150
<!-- If there is no MiliSearch enabled, use the PyData search -->
52-
{%- extends "pydata_sphinx_theme/components/search-field.html" -%}
51+
{%- include "pydata_sphinx_theme/components/search-field.html" -%}
5352
{% endif %}
5453

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
{% if theme_use_meilisearch %}
2+
{%- extends "page.html" %}
3+
{%- block content %}
4+
{# checkbox to toggle primary sidebar #}
5+
<input type="checkbox"
6+
class="sidebar-toggle"
7+
name="__primary"
8+
id="__primary"/>
9+
<label class="overlay overlay-primary" for="__primary"></label>
10+
{# Checkboxes to toggle the secondary sidebar #}
11+
<input type="checkbox"
12+
class="sidebar-toggle"
13+
name="__secondary"
14+
id="__secondary"/>
15+
<label class="overlay overlay-secondary" for="__secondary"></label>
16+
{%- if theme_announcement -%}
17+
{% include "sections/announcement.html" %}
18+
{%- endif %}
19+
{% block docs_navbar %}
20+
<nav class="bd-header navbar navbar-expand-lg bd-navbar">
21+
{%- include "sections/header.html" %}
22+
</nav>
23+
{% endblock docs_navbar %}
24+
<div class="bd-container">
25+
<div class="bd-container__inner bd-page-width">
26+
{# Primary sidebar #}
27+
<div class="bd-sidebar-primary bd-sidebar{% if not sidebars %} hide-on-wide{% endif %}">
28+
{% include "sections/sidebar-primary.html" %}
29+
</div>
30+
{# Using an ID here so that the skip-link works #}
31+
<main id="main-content" class="bd-main">
32+
{# Main content area #}
33+
{% block docs_main %}
34+
<div class="bd-content">
35+
<div class="bd-article-container">
36+
{# Article header #}
37+
<div class="bd-header-article">{% include "sections/header-article.html" %}</div>
38+
{# Article content #}
39+
{% block docs_body %}
40+
<div class="bd-search-container">
41+
<h1>{{ _("Search") }}</h1>
42+
{% include "components/search-field.html" %}
43+
</div>
44+
{% endblock docs_body %}
45+
{# Article Footer #}
46+
{% if theme_show_prev_next %}
47+
<footer class="bd-footer-article">
48+
{% include "sections/footer-article.html" %}
49+
</footer>
50+
{% endif %}
51+
</div>
52+
{# Secondary sidebar #}
53+
{% block docs_toc %}
54+
{% if not remove_sidebar_secondary %}
55+
<div class="bd-sidebar-secondary bd-toc">{% include "sections/sidebar-secondary.html" %}</div>
56+
{% endif %}
57+
{% endblock docs_toc %}
58+
</div>
59+
<footer class="bd-footer-content">
60+
{% include "sections/footer-content.html" %}
61+
</footer>
62+
{% endblock docs_main %}
63+
</main>
64+
</div>
65+
</div>
66+
{# Scripts placed at the end of the page to cut down on time to first content #}
67+
{%- block scripts_end %}{{ _webpack.body_post() }}{%- endblock scripts_end %}
68+
{%- endblock content %}
69+
{% else %}
70+
<!-- If there is no MeiliSearch enabled, use the PyData search -->
71+
{%- include "pydata_sphinx_theme/search.html" -%}
72+
{% endif %}

0 commit comments

Comments
 (0)