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