diff --git a/templates/index.html b/templates/index.html index a103f7f..c0b253f 100644 --- a/templates/index.html +++ b/templates/index.html @@ -34,12 +34,17 @@ {# ───────── News (loaded from content/news.md) ───────── #} +{# Mirror live's news.html.twig: section-title always wraps the h2 in + `.anchor` (with empty id), and the content lands inside an outer

+ tag — the auto-close on the first inner

yields one leading + empty

, which contributes the 10px-margin that Grav's markdown + pipeline produces. #} {% set news_page = get_page(path="news.md") %}
- {{ st::section_title(title="Aktuelles") }} + {{ st::section_title(title="Aktuelles", with_anchor=true) }}
- {{ news_page.content | safe }} +

{{ news_page.content | safe }}

diff --git a/templates/macros/section_title.html b/templates/macros/section_title.html index 1db100e..0e01f8a 100644 --- a/templates/macros/section_title.html +++ b/templates/macros/section_title.html @@ -1,7 +1,11 @@ -{% macro section_title(title, anchor="") %} +{# `with_anchor=true` forces the `
` wrap + even when the anchor id is empty — matches the live news.html.twig + which always renders the wrap. A non-empty `anchor` argument implies + `with_anchor=true` automatically. #} +{% macro section_title(title, anchor="", with_anchor=false) %}
- {%- if anchor %} + {%- if anchor or with_anchor %}

{{ title }}

diff --git a/templates/macros/team_carousel.html b/templates/macros/team_carousel.html index da0bfe0..76cbed3 100644 --- a/templates/macros/team_carousel.html +++ b/templates/macros/team_carousel.html @@ -1,14 +1,10 @@ {% macro team_carousel(title, anchor, slides) %}
+ {# Live's employees.html.twig renders the h2 directly, without an + `.anchor` wrapper — keep that to match its vertical rhythm. #}
- {%- if anchor %} -
-

{{ title }}

-
- {%- else %}

{{ title }}

- {%- endif %}