Skip to content

Commit

Permalink
support sphinx i hope (#278)
Browse files Browse the repository at this point in the history
  • Loading branch information
nabobalis authored Apr 18, 2024
1 parent b39f90b commit 2e3ac8d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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']
Expand Down
5 changes: 5 additions & 0 deletions docs/release/ablog-v0.11-released.rst
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,8 @@ Pull Requests merged in:


`Add span to more items in templates <https://github.com/sunpy/ablog/pull/270>`__ from `Nabil Freij <https://github.com/nabobalis>`__.

ABlog v0.11.8 released
----------------------

Added support for ``sphinx`` >=7.3.0
9 changes: 8 additions & 1 deletion src/ablog/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 2e3ac8d

Please sign in to comment.