diff --git a/templates/index.html b/templates/index.html index e5545b9..9fff368 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1,8 +1,98 @@ - - -{{ config.title }} - -

{{ config.title }}

-

{{ section.content | safe }}

- - +{% extends "base.html" %} +{% import "macros/image.html" as image %} + +{% block content %} + +{# ───────── Carousel ───────── #} + + +{# ───────── News (loaded from content/news.md) ───────── #} +{% set news_page = get_page(path="news.md") %} +
+
+ {{ news_page.content | safe }} +
+
+ +{# ───────── About columns ───────── #} +
+
+
+ {% for col in section.extra.about_columns %} +
{{ col.text | markdown(inline=false) | safe }}
+ {% endfor %} +
+
+
+ +{# ───────── Service grid ───────── #} +
+
+

Unsere Leistungen

+ +
+
+ +{# ───────── Team preview ───────── #} +{% if section.extra.team_preview %} +
+
+

Unser Team

+ +
+
+{% endif %} + +{# Notfall block intentionally skipped — was `published: false` in Grav. #} + +{# ───────── Map ───────── #} +{# Map shortcode added in Task 20; left as a placeholder comment here. #} +{# {{ map() }} #} + +{% endblock %} diff --git a/templates/macros/image.html b/templates/macros/image.html new file mode 100644 index 0000000..b25fb63 --- /dev/null +++ b/templates/macros/image.html @@ -0,0 +1,15 @@ +{# Image-rendering macro, used both by templates (directly via import) + and indirectly by the `img` shortcode (which forwards to it). #} + +{% macro render(src, width, alt="", class="") %} + {%- set source_path = "static/images/" ~ src -%} + {%- set resized = resize_image(path=source_path, width=width, op="fit_width", quality=85) -%} + {{ alt }} +{% endmacro render %} diff --git a/templates/shortcodes/img.html b/templates/shortcodes/img.html index e73b2d5..7f22284 100644 --- a/templates/shortcodes/img.html +++ b/templates/shortcodes/img.html @@ -1,16 +1,8 @@ -{# Image shortcode with width-based resize and lazy loading. +{# Image shortcode for use inside Markdown content. + Forwards to the shared image macro so we have one source of truth. Usage in markdown: {{ img(src="team/Olli.jpg", width=400, alt="Dr. Riemann") }} - {{ img(src="carousel/page1.jpg", width=1920, alt="Praxis") }} - Class is optional, e.g. class="float-right". #} - -{%- set source_path = "static/images/" ~ src -%} -{%- set resized = resize_image(path=source_path, width=width, op="fit_width", quality=85) -%} -{{ alt | default(value= + {{ img(src="services/HV.jpg", width=600, alt="...", class="float-right") }} +#} +{%- import "macros/image.html" as image -%} +{{ image::render(src=src, width=width, alt=alt | default(value=""), class=class | default(value="")) }}