Skip to content

Commit

Permalink
Release notes
Browse files Browse the repository at this point in the history
  • Loading branch information
nabobalis committed Nov 1, 2024
1 parent ac3ca5e commit 7e4577e
Show file tree
Hide file tree
Showing 9 changed files with 47 additions and 25 deletions.
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ci:
autoupdate_schedule: "quarterly"
repos:
- repo: https://github.com/PyCQA/docformatter
rev: v1.7.5
rev: eb1df347edd128b30cd3368dddc3aa65edcfac38
hooks:
- id: docformatter
args: ["--in-place", "--pre-summary-newline", "--make-summary-multi"]
Expand All @@ -19,13 +19,13 @@ repos:
]
exclude: ".*(.fits|.fts|.fit|.txt|tca.*|extern.*|.rst|.md|docs/conf.py)$"
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.5.0"
rev: "v0.7.2"
hooks:
- id: ruff
args: ["--fix", "--unsafe-fixes"]
- id: ruff-format
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v5.0.0
hooks:
- id: check-ast
- id: check-case-conflict
Expand All @@ -48,7 +48,7 @@ repos:
hooks:
- id: prettier
- repo: https://github.com/Riverside-Healthcare/djLint
rev: v1.34.1
rev: v1.35.4
hooks:
- id: djlint-jinja
types_or: ["html"]
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"Ahmet": ("Ahmet Bakan", "https://ahmetbakan.com"),
"Luc": ("Luc Saffre", "https://saffre-rumma.net/luc/"),
"Mehmet": ("Mehmet Gerçeker", "https://github.com/mehmetg"),
"Libor": ("Libor Jelínek", "https://liborjelinek.github.io/")
"Libor": ("Libor Jelínek", "https://liborjelinek.github.io/"),
}
blog_feed_archives = True
blog_feed_fulltext = True
Expand Down
20 changes: 10 additions & 10 deletions docs/manual/templates-themes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ Blog sidebars

Sidebars are a common way to provide additional information to the reader. There are seven Ablog sidebars you can include in your HTML output using the Sphinx_ :confval:`html_sidebars` configuration option (in addition to your theme sidebars).

- ``alog/postcard.html`` provides information regarding the current post (when on a post page).
- ``alog/recentposts.html`` lists the most recent five posts.
- ``alog/tagcloud.html`` provides links to archive pages generated for each tag.
- ``alog/category.html``, ``alog/authors.html``, ``alog/languages.html``, and ``alog/locations.html`` sidebars generate lists of links to respective archive pages with the number of matching posts (e.g., "Manual (14)", "2023 (8)", "English (22)").
- ``ablog/postcard.html`` provides information regarding the current post (when on a post page).
- ``ablog/recentposts.html`` lists the most recent five posts.
- ``ablog/tagcloud.html`` provides links to archive pages generated for each tag.
- ``ablog/category.html``, ``ablog/authors.html``, ``ablog/languages.html``, and ``ablog/locations.html`` sidebars generate lists of links to respective archive pages with the number of matching posts (e.g., "Manual (14)", "2023 (8)", "English (22)").

For example, the sidebars that you see on this website on the left are:

Expand All @@ -32,7 +32,7 @@ For example, the sidebars that you see on this website on the left are:
html_sidebars = {
"**": [
# Comes from Alabaster theme
"about.html",
"about.html",
"searchfield.html",
# Ablog sidebars
"ablog/postcard.html",
Expand All @@ -54,7 +54,7 @@ Ablog standard sidebars are wrapped in ``<div>`` with CSS classes like :samp:`ab
For example, the ``recentposts.html`` template is wrapped in ``<div class="ablog-sidebar-item ablog__recentposts">``.

.. seealso::

Built-in sidebars can be found in the ``ablog/`` folder in the `Ablog source code <https://github.com/sunpy/ablog/tree/main/src/ablog/templates/ablog>`_.

If styling is not enough, you can override the Ablog templates in your Sphinx project or in the Sphinx theme.
Expand All @@ -65,7 +65,7 @@ Partial or complete override of Ablog templates
To control whether Ablog injects its own templates into the Sphinx build, you can use the following ``conf.py`` configuration option:

.. confval:: skip_injecting_base_ablog_templates

If set to ``True``, Ablog will not inject its own templates into the Sphinx build. This is useful if you want to completely override Ablog templates in your Sphinx project or in the Sphinx theme. The default is ``False``.

Customizing templates in the project
Expand Down Expand Up @@ -95,7 +95,7 @@ If you are a Sphinx theme author, you can ship customized Ablog templates in you
#. In your ``theme.toml`` file, add the following (under the ``[options]`` section):

.. code-block:: toml
ablog_inject_templates_after_theme = true
This will ensure that Ablog templates are injected *after* the theme templates, so you can override them while still using the Ablog templates as a fallback.
This will ensure that Ablog templates are injected *after* the theme templates, so you can override them while still using the Ablog templates as a fallback.
11 changes: 11 additions & 0 deletions docs/release/ablog-v0.11-released.rst
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,14 @@ Mark Ablog parallel safe.

Dropped support for Python 3.9, Sphinx less than 6.2.
This mirrors the requirements for alabaster 1.0.0.

ABlog v0.11.12 released
-----------------------

`Improve ablog-configuration-options.rst. <https://github.com/sunpy/ablog/pull/292>`__ from `Libor Jelínek <https://github.com/liborjelinek>`__.

`Fix sidebars CSS naming. <https://github.com/sunpy/ablog/pull/298>`__ from `Libor Jelínek <https://github.com/liborjelinek>`__.

`Ablog is NOT safe for parallel read. <https://github.com/sunpy/ablog/pull/299>`__ from `Libor Jelínek <https://github.com/liborjelinek>`__.

`Fix theme support for ablog. <https://github.com/sunpy/ablog/pull/295>`__ from `Libor Jelínek <https://github.com/liborjelinek>`__.
2 changes: 1 addition & 1 deletion roots/test-templates/_templates/ablog/postcard.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
custom postcard.html
custom postcard.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
custom postcard.html from theme
custom postcard.html from theme
1 change: 0 additions & 1 deletion roots/test-templates/conf.py
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
extensions = ["ablog"]

6 changes: 5 additions & 1 deletion src/ablog/tests/test_parallel.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@


def test_not_safe_for_parallel_read(rootdir: Path, tmp_path: Path):
"""Ablog is NOT safe for parallel read. In such case, it doesn't collect any posts."""
"""
Ablog is NOT safe for parallel read.
In such case, it doesn't collect any posts.
"""
# https://github.com/sunpy/ablog/issues/297
# Very ugly hack to change the parallel_read_safe value to True
good_read_safe = '"parallel_read_safe": False'
Expand Down
20 changes: 14 additions & 6 deletions src/ablog/tests/test_templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@

@pytest.mark.sphinx("html", testroot="templates", confoverrides={"skip_injecting_base_ablog_templates": True})
def test_skip_ablog_templates_but_missing_templates(app: Sphinx):
"""Completely override the templates used by ablog, but not provide them."""
"""
Completely override the templates used by ablog, but not provide them.
"""
with pytest.raises(
ThemeError,
match=r"An error happened in rendering the page blog/author\.\nReason: TemplateNotFound\(\"'ablog/catalog.html' not found in *.",
Expand All @@ -22,7 +24,7 @@ def test_skip_ablog_templates_but_missing_templates(app: Sphinx):
"skip_injecting_base_ablog_templates": False, # default value
"html_sidebars": {
"**": [
# overriden by user
# overridden by user
"ablog/postcard.html",
# fallback to builtin
"ablog/authors.html",
Expand All @@ -31,7 +33,10 @@ def test_skip_ablog_templates_but_missing_templates(app: Sphinx):
},
)
def test_override_template_but_fallback_missing(app: Sphinx, rootdir: Path):
"""Partically override the only some Ablog templates, but use the Ablog ones for missing as fallback."""
"""
Partially override the only some Ablog templates, but use the Ablog ones
for missing as fallback.
"""
app.build()

# is the customized template it in the output?
Expand All @@ -50,7 +55,7 @@ def test_override_template_but_fallback_missing(app: Sphinx, rootdir: Path):
confoverrides={
"html_sidebars": {
"**": [
# overriden by theme
# overridden by theme
"ablog/postcard.html",
# fallback to builtin
"ablog/authors.html",
Expand All @@ -61,7 +66,10 @@ def test_override_template_but_fallback_missing(app: Sphinx, rootdir: Path):
},
)
def test_themes_templates_come_first(app: Sphinx, rootdir: Path):
"""Ensures that if theme supplies own Ablog template, it is used over the builtin one, but fallback to builtin for missing ones."""
"""
Ensures that if theme supplies own Ablog template, it is used over the
builtin one, but fallback to builtin for missing ones.
"""
app.build()

# is the customized template it in the output?
Expand All @@ -71,4 +79,4 @@ def test_themes_templates_come_first(app: Sphinx, rootdir: Path):

# is builtin template in the output?
builtin = '<div class="ablog-sidebar-item ablog__authors">'
assert builtin in source
assert builtin in source

0 comments on commit 7e4577e

Please sign in to comment.