|
27 | 27 | project = "ansys-stk" |
28 | 28 | copyright = f"(c) {datetime.now().year} ANSYS, Inc. All rights reserved" |
29 | 29 | author = "ANSYS, Inc." |
30 | | -release = version = __version__ |
| 30 | +version = __version__ |
| 31 | +release = get_version_match(version) |
31 | 32 | cname = os.getenv("DOCUMENTATION_CNAME", "stk.docs.pyansys.com") |
32 | 33 |
|
33 | 34 | # Configure the HTML theme |
|
39 | 40 | "github_repo": "pystk", |
40 | 41 | "github_version": "main", |
41 | 42 | "doc_path": "doc/source", |
42 | | - "version": "main" if version.endswith("dev0") else f"release/{version.split('.')[:-1]}", |
| 43 | + "version": "main" if version.endswith("dev0") else f"release/{release}", |
43 | 44 | "base_url": f"https://github.com/ansys/pystk/blob/main", |
44 | 45 | "edit_page_provider_name": "GitHub", |
45 | 46 | "edit_page_url_template": "{{ base_url }}/{{ 'doc/source/' if 'examples/' not in file_name else '' }}{{ file_name }}", |
|
66 | 67 | ], |
67 | 68 | "switcher": { |
68 | 69 | "json_url": f"https://{cname}/versions.json", |
69 | | - "version_match": get_version_match(__version__), |
| 70 | + "version_match": release, |
70 | 71 | }, |
71 | 72 | "check_switcher": False, |
72 | 73 | "navigation_with_keys": True, |
|
178 | 179 | # -- Linkcheck configuration ------------------------------------------------- |
179 | 180 | user_repo = f"{html_context['github_user']}/{html_context['github_repo']}" |
180 | 181 | linkcheck_ignore = [ |
181 | | - "https://www.ansys.com/*", |
| 182 | + r"https://www.ansys.com/*", |
182 | 183 | # Requires sign-in |
183 | | - f"https://github.com/{user_repo}/*", |
184 | | - "https://support.agi.com/3d-models", |
185 | | - "https://support.agi.com/downloads", |
186 | | - "https://www.khronos.org/collada/", |
| 184 | + r"https://support.agi.com/3d-models", |
| 185 | + r"https://support.agi.com/downloads", |
| 186 | + # Spurious failures |
| 187 | + r"https://www.khronos.org/collada/", |
| 188 | + r"https://www.khronos.org/gltf/", |
187 | 189 | # TODO: Determine a way to link to examples without breaking the linkcheck |
188 | 190 | # https://github.com/ansys/pystk/issues/657 |
189 | 191 | r"../examples/", |
| 192 | + # Ignore links to the examples pdf/ipynb/py files as they are not |
| 193 | + # available until documentation is not published |
| 194 | + rf"https://{cname}/version/{release}/examples/.*\.pdf", |
| 195 | + rf"https://{cname}/version/{release}/examples/.*\.ipynb", |
| 196 | + rf"https://{cname}/version/{release}/examples/.*\.py", |
190 | 197 | ] |
191 | 198 |
|
192 | 199 | # -- Declare the Jinja context ----------------------------------------------- |
|
0 commit comments