diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f263772c..04e6c440 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,11 +12,11 @@ repos: hooks: - id: isort - repo: https://github.com/psf/black - rev: 24.3.0 + rev: 24.4.0 hooks: - id: black - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 + rev: v4.6.0 hooks: - id: check-ast - id: check-case-conflict @@ -26,7 +26,7 @@ repos: - id: check-yaml - id: debug-statements - repo: https://github.com/astral-sh/ruff-pre-commit - rev: 'v0.3.5' + rev: 'v0.3.7' hooks: - id: ruff args: ['--fix'] diff --git a/docs/release/ablog-v0.11-released.rst b/docs/release/ablog-v0.11-released.rst index 7858f09c..39709800 100644 --- a/docs/release/ablog-v0.11-released.rst +++ b/docs/release/ablog-v0.11-released.rst @@ -85,3 +85,8 @@ Pull Requests merged in: `Add span to more items in templates `__ from `Nabil Freij `__. + +ABlog v0.11.8 released +---------------------- + +Added support for ``sphinx`` >=7.3.0 diff --git a/src/ablog/__init__.py b/src/ablog/__init__.py index fb508748..e6c295e4 100755 --- a/src/ablog/__init__.py +++ b/src/ablog/__init__.py @@ -7,6 +7,7 @@ from pathlib import PurePath from sphinx.builders.html import StandaloneHTMLBuilder +from sphinx.errors import ThemeError from sphinx.jinja2glue import BuiltinTemplateLoader, SphinxFileSystemLoader from sphinx.locale import get_translation @@ -118,7 +119,13 @@ def builder_inited(app): theme = app.builder.theme loaders = app.builder.templates.loaders templatepathlen = app.builder.templates.templatepathlen - if theme.get_config("ablog", "inject_templates_after_theme", False): + try: + # Modern Sphinx now errors instead of returning the default if there is not a value + # in any of the config files. + after_theme = theme.get_config("ablog", "inject_templates_after_theme", False) + except ThemeError: + after_theme = False + if after_theme: # Inject *after* the user templates and the theme templates, # allowing themes to override the templates provided by this # extension while those templates still serve as a fallback.