summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSarah Abderemane <sarahabderemane@gmail.com>2026-04-27 19:00:18 +0200
committerSaptak Sengupta <saptak013@gmail.com>2026-04-27 23:20:32 +0530
commitd53a2c32b5882822abbc9cf97f510d4b4fb50be4 (patch)
tree13f34b4f5dceb2cfe495ab3b593a8336558b26ba
parent8b131cf30ede2c578d6d84aaf6f89ca5b2b5db46 (diff)
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.
-rw-r--r--blog/models.py4
-rw-r--r--blog/tests.py4
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, '<div class="section" id="s-test"><h3>test</h3></div>'
+ entry.body_html, '<div class="section" id="s-test"><h1>test</h1></div>'
)
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, '<h3 id="s-test">test</h3>')
+ self.assertHTMLEqual(entry.body_html, '<h1 id="s-test">test</h1>')
def test_pub_date_localized(self):
entry = Entry(pub_date=date(2005, 7, 21))