From 7e4577ec60e998462b1c2b5b996bf8a945e4ed46 Mon Sep 17 00:00:00 2001 From: Nabil Freij Date: Fri, 1 Nov 2024 11:44:10 -0700 Subject: [PATCH] Release notes --- .pre-commit-config.yaml | 8 ++++---- docs/conf.py | 2 +- docs/manual/templates-themes.rst | 20 +++++++++---------- docs/release/ablog-v0.11-released.rst | 11 ++++++++++ .../_templates/ablog/postcard.html | 2 +- .../_themes/test_theme/ablog/postcard.html | 2 +- roots/test-templates/conf.py | 1 - src/ablog/tests/test_parallel.py | 6 +++++- src/ablog/tests/test_templates.py | 20 +++++++++++++------ 9 files changed, 47 insertions(+), 25 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8b959bc2..a1dc5326 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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"] @@ -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 @@ -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"] diff --git a/docs/conf.py b/docs/conf.py index 4d634e6c..8c88230f 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -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 diff --git a/docs/manual/templates-themes.rst b/docs/manual/templates-themes.rst index 42e5ee81..1b0fbcd6 100644 --- a/docs/manual/templates-themes.rst +++ b/docs/manual/templates-themes.rst @@ -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: @@ -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", @@ -54,7 +54,7 @@ Ablog standard sidebars are wrapped in ``
`` with CSS classes like :samp:`ab For example, the ``recentposts.html`` template is wrapped in ``
``. .. seealso:: - + Built-in sidebars can be found in the ``ablog/`` folder in the `Ablog source code `_. If styling is not enough, you can override the Ablog templates in your Sphinx project or in the Sphinx theme. @@ -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 @@ -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. \ No newline at end of file + + 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. diff --git a/docs/release/ablog-v0.11-released.rst b/docs/release/ablog-v0.11-released.rst index 40cf9575..9936afd3 100644 --- a/docs/release/ablog-v0.11-released.rst +++ b/docs/release/ablog-v0.11-released.rst @@ -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. `__ from `Libor Jelínek `__. + +`Fix sidebars CSS naming. `__ from `Libor Jelínek `__. + +`Ablog is NOT safe for parallel read. `__ from `Libor Jelínek `__. + +`Fix theme support for ablog. `__ from `Libor Jelínek `__. diff --git a/roots/test-templates/_templates/ablog/postcard.html b/roots/test-templates/_templates/ablog/postcard.html index f2093689..834f8dd0 100644 --- a/roots/test-templates/_templates/ablog/postcard.html +++ b/roots/test-templates/_templates/ablog/postcard.html @@ -1 +1 @@ -custom postcard.html \ No newline at end of file +custom postcard.html diff --git a/roots/test-templates/_themes/test_theme/ablog/postcard.html b/roots/test-templates/_themes/test_theme/ablog/postcard.html index 21bcc3e8..59d4c359 100644 --- a/roots/test-templates/_themes/test_theme/ablog/postcard.html +++ b/roots/test-templates/_themes/test_theme/ablog/postcard.html @@ -1 +1 @@ -custom postcard.html from theme \ No newline at end of file +custom postcard.html from theme diff --git a/roots/test-templates/conf.py b/roots/test-templates/conf.py index 8ba79c25..9fefc4cd 100644 --- a/roots/test-templates/conf.py +++ b/roots/test-templates/conf.py @@ -1,2 +1 @@ extensions = ["ablog"] - diff --git a/src/ablog/tests/test_parallel.py b/src/ablog/tests/test_parallel.py index 2e355f07..1822fa91 100644 --- a/src/ablog/tests/test_parallel.py +++ b/src/ablog/tests/test_parallel.py @@ -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' diff --git a/src/ablog/tests/test_templates.py b/src/ablog/tests/test_templates.py index ef9ef613..41f0e3bf 100644 --- a/src/ablog/tests/test_templates.py +++ b/src/ablog/tests/test_templates.py @@ -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 *.", @@ -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", @@ -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? @@ -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", @@ -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? @@ -71,4 +79,4 @@ def test_themes_templates_come_first(app: Sphinx, rootdir: Path): # is builtin template in the output? builtin = '
' - assert builtin in source \ No newline at end of file + assert builtin in source