Files
praxis-page/templates/macros/image.html
T
Brummel 9cf54f9459 feat: home page template with carousel, news, about, services, team sections
- Extends base.html, uses shared image macro for resize_image
- Refactored img shortcode to forward to macros/image.html (DRY)
- News pulled via get_page from content/news.md
- Notfall section skipped (was unpublished in grav)
- Map call commented out until shortcode lands in Task 20
2026-05-20 22:39:59 +02:00

16 lines
553 B
HTML

{# 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) -%}
<img
src="{{ resized.url }}"
width="{{ resized.width }}"
height="{{ resized.height }}"
alt="{{ alt }}"
{%- if class %} class="{{ class }}"{% endif %}
loading="lazy"
>
{% endmacro render %}