diff --git a/theme/templates/index.html b/theme/templates/index.html index 6a7e4d67c6c6604eef7165b9601c71e592eb944a..8ec6205c215ef6b138140061242db35a7c0ced09 100644 --- a/theme/templates/index.html +++ b/theme/templates/index.html @@ -6,10 +6,8 @@ {% endblock breadcrumb %} {% block page_header %} -<header class="visuallyhidden"> - <h1>{{ common.softbreak_span(page.title) }}</h1> -</header> -<hr> + {{ common.render_header(page.title, 1, {"classes": ["visuallyhidden"]}, lang) }} + <hr> {% endblock %} {% block page_footer %} diff --git a/theme/templates/macros/common.html b/theme/templates/macros/common.html index ef9c188e183d5d38d8df515c1e67d4707dbe8668..30d4a5cb61d169498b9df566629133b68abb9bff 100644 --- a/theme/templates/macros/common.html +++ b/theme/templates/macros/common.html @@ -63,8 +63,15 @@ {#- ############################# HEADER ################################## -#} {%- macro render_header(content, level, attr, lang) -%} + {%- call render_header_raw(content, level, attr, lang) -%} + {{ softbreak_span(content) }} + {%- endcall -%} +{%- endmacro -%} + + +{%- macro render_header_raw(content, level, attr, lang) -%} <header {{ render_attr(attr, lang) }}> - <h{{ level }}>{{ render_inlines(content, lang) }}</h{{ level }}> + <h{{ level }}>{{ caller() }}</h{{ level }}> </header> {%- endmacro -%} diff --git a/theme/templates/macros/content_renderer.html b/theme/templates/macros/content_renderer.html index 53f2b50807f47137e1c440a0518a4365c347e03c..286921aa5cd978616f9f5753cc32440b9569e1e0 100644 --- a/theme/templates/macros/content_renderer.html +++ b/theme/templates/macros/content_renderer.html @@ -20,11 +20,12 @@ {%- endmacro -%} {%- macro render_header(content, level, attr, lang) -%} - <header {{ common.render_attr(attr, lang) }}> - <h{{ level }}>{{ render_inlines(content, lang) }}</h{{ level }}> - </header> + {%- call common.render_header_raw(content, level, attr, lang) -%} + {{ render_inlines(content, lang) }} + {%- endcall -%} {%- endmacro -%} + {%- macro render_orderedlist_type(style, delim) -%} {#- TODO also use delim: default | period | one_parenthesis | two_parentheses -#} {%- if style == "default" -%}1 @@ -115,9 +116,8 @@ {%- set level = block['level'] -%} {%- set attr = block['attr'] -%} {%- set content = block['content'] -%} - <header {{ common.render_attr(attr, lang) }}> - <h{{ level }}>{{ render_inlines(content, lang) }}</h{{ level }}> - </header> + + {{ render_header(content, level, attr, lang) }} {%- endmacro -%} {%- macro render_block_paragraph(block, lang) -%} diff --git a/theme/templates/page.html b/theme/templates/page.html index c3f34a4c767fd5f9001d3496f559a8653821b3e2..8e0b53a3dfb60be1be810c57a2c0e23d16ec9c9f 100644 --- a/theme/templates/page.html +++ b/theme/templates/page.html @@ -12,9 +12,7 @@ {% block main %} <article> {% block page_header %} - <header> - <h1>{{ common.softbreak_span(page.title) }}</h1> - </header> + {{ common.render_header(page.title, 1, None, lang) }} {% endblock %} {% block page_content %} {%- if 'before' in page.metadata -%}