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
This commit is contained in:
@@ -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) -%}
|
||||
<img
|
||||
src="{{ resized.url }}"
|
||||
width="{{ resized.width }}"
|
||||
height="{{ resized.height }}"
|
||||
alt="{{ alt }}"
|
||||
{%- if class %} class="{{ class }}"{% endif %}
|
||||
loading="lazy"
|
||||
>
|
||||
{% endmacro render %}
|
||||
Reference in New Issue
Block a user