From d53a2c32b5882822abbc9cf97f510d4b4fb50be4 Mon Sep 17 00:00:00 2001 From: Sarah Abderemane Date: Mon, 27 Apr 2026 19:00:18 +0200 Subject: Update initial header level in BLOG_DOCUTILS_SETTINGS to 1 This will allow to get correct headings levels in the website and review content headings to match the change. --- blog/models.py | 4 ++-- blog/tests.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/blog/models.py b/blog/models.py index eb97b2ac..06fcee6f 100644 --- a/blog/models.py +++ b/blog/models.py @@ -17,7 +17,7 @@ from markdown.extensions.toc import TocExtension, slugify as _md_title_slugify BLOG_DOCUTILS_SETTINGS = { "doctitle_xform": False, - "initial_header_level": 3, + "initial_header_level": 1, "id_prefix": "s-", "raw_enabled": False, "file_insertion_enabled": False, @@ -62,8 +62,8 @@ class ContentFormat(models.TextChoices): output_format="html", extensions=[ # baselevel matches `initial_header_level` from BLOG_DOCUTILS_SETTINGS - TocExtension(baselevel=3, slugify=_md_slugify), "tables", + TocExtension(baselevel=1, slugify=_md_slugify), ], ) raise ValueError(f"Unsupported format {fmt}") diff --git a/blog/tests.py b/blog/tests.py index 5b6b0ea6..87f3fc14 100644 --- a/blog/tests.py +++ b/blog/tests.py @@ -129,7 +129,7 @@ class EntryTestCase(DateTimeMixin, TestCase): content_format=ContentFormat.REST, ) self.assertHTMLEqual( - entry.body_html, '

test

' + entry.body_html, '

test

' ) def test_header_base_level_markdown(self): @@ -139,7 +139,7 @@ class EntryTestCase(DateTimeMixin, TestCase): body="# test", content_format=ContentFormat.MARKDOWN, ) - self.assertHTMLEqual(entry.body_html, '

test

') + self.assertHTMLEqual(entry.body_html, '

test

') def test_pub_date_localized(self): entry = Entry(pub_date=date(2005, 7, 21)) -- cgit v1.3