fix(images): match live <p>-wrapped img markup, drop width/height attrs
Two related fixes for the visual gaps reported after the previous pass:
1. Doctor portraits on /team were horizontally compressed. Cause: explicit
width="200"/height="200" attributes interacted with Bootstrap's
`img { display:block; max-width:100%; height:auto }` and `.float-right`
padding to squish the rendered box. Dropping the attributes lets the
browser use the resized image's intrinsic 200x200 dimensions, with the
padding sitting around the image instead of inside its width.
2. Vertical rhythm was a few pixels off vs live. Cause: the live Grav
markdown wraps standalone image references in <p> (markdown spec),
adding the expected paragraph margin. Our shortcode emitted bare <img>
with no wrapper, so the following <p> was visually slightly closer.
Wrap the shortcode calls in <p> in the 6 service pages and 3 doctor
blocks to restore the rhythm.
This commit is contained in:
@@ -6,7 +6,7 @@ weight = 20
|
||||
anchor = "Corona"
|
||||
+++
|
||||
|
||||
{{ img(src="services/Corona.jpg", alt="Corona", class="float-right") }}
|
||||
<p>{{ img(src="services/Corona.jpg", alt="Corona", class="float-right") }}</p>
|
||||
|
||||
Seit Beginn der Coronapandemie führen wir in unserer Praxis Tests auf das Corona-Virus (SARS-CoV-2) durch.
|
||||
Zum Schutz aller Anwesenden werden Tests bei Patientinnen und Patienten **mit Symptomen**, sowie deren **Kontaktpersonen**, ausschließlich während
|
||||
|
||||
@@ -6,7 +6,7 @@ weight = 60
|
||||
anchor = "Diabetologie"
|
||||
+++
|
||||
|
||||
{{ img(src="services/Diabetologie.jpg", alt="Diabetologie", class="float-right") }}
|
||||
<p>{{ img(src="services/Diabetologie.jpg", alt="Diabetologie", class="float-right") }}</p>
|
||||
|
||||
Einer unserer internen Schwerpunkte ist die qualifizierte Behandlung von Patientinnen und Patienten die unter **Diabetes mellitus (Zuckerkrankheit)** leiden. Unser Diabetesteam besteht aus unserem Diabetologen [Dr. Riemann](/team#Riemann) und mehreren Diabetes-Assistentinnen.
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ weight = 40
|
||||
anchor = "Diagnostik"
|
||||
+++
|
||||
|
||||
{{ img(src="services/Diagnostik.jpg", alt="Diagnostik", class="float-right") }}
|
||||
<p>{{ img(src="services/Diagnostik.jpg", alt="Diagnostik", class="float-right") }}</p>
|
||||
|
||||
* **EKG** und **Belastungs-EKG**
|
||||
* **24h-Langzeit-Blutdruckmessung**
|
||||
|
||||
@@ -6,7 +6,7 @@ weight = 10
|
||||
anchor = "HV"
|
||||
+++
|
||||
|
||||
{{ img(src="services/HV.jpg", alt="Hausärztliche Versorgung", class="float-right") }}
|
||||
<p>{{ img(src="services/HV.jpg", alt="Hausärztliche Versorgung", class="float-right") }}</p>
|
||||
|
||||
**Als Hausarztpraxis** verstehen wir uns als Ihre ersten Ansprechpartner in allen medizinischen Fragen und sind für Sie die Lotsen im oftmals unübersichtlichen Gesundheitssystem.
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ weight = 50
|
||||
anchor = "Kardio"
|
||||
+++
|
||||
|
||||
{{ img(src="services/Kardio.jpg", alt="Kardiologie", class="float-right") }}
|
||||
<p>{{ img(src="services/Kardio.jpg", alt="Kardiologie", class="float-right") }}</p>
|
||||
|
||||
Die **Kardiologie** ist die Lehre des Herzens und seiner Erkrankungen. Sie umfasst die _koronare Herzerkrankung_ (Durchblutungsstörungen des Herzens), den _Herzinfarkt_, die _Bluthochdruckerkrankung_, _Herzschwäche_, _Herzklappenfehler_, _Herzrhythmusstörungen_, _Herzmuskelerkrankungen_, und vieles mehr.
|
||||
Wir bieten Ihnen auf diesem Gebiet sinnvolle Vorsorgeuntersuchungen an. Bei bekannter Herzkrankheit und bei Verdacht auf Herz-Gefäßerkrankungen bieten wir kompetente Beratung, Diagnostik und Therapie.
|
||||
|
||||
@@ -6,7 +6,7 @@ weight = 30
|
||||
anchor = "Vorsorge"
|
||||
+++
|
||||
|
||||
{{ img(src="services/Vorsorge.jpg", alt="Vorsorge", class="float-right") }}
|
||||
<p>{{ img(src="services/Vorsorge.jpg", alt="Vorsorge", class="float-right") }}</p>
|
||||
|
||||
**Vorsorge** hilft bei der frühzeitigen Erkennung von Krankheiten und der Aufdeckung von persönlichen Risikofaktoren. Sie beinhaltet die Beratung zur individuellen Risikoreduktion. Impfungen schützen Sie und Ihr Umfeld vor Infektionskrankheiten.
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ anchor = "doctors"
|
||||
+++
|
||||
|
||||
<h1 id="Riemann" class="anchor">Dr. med. Oliver Riemann</h1>
|
||||
{{ img(src="team/Olli.jpg", width=200, alt="Dr. med Oliver Riemann", class="float-right") }}
|
||||
<p>{{ img(src="team/Olli.jpg", width=200, alt="Dr. med Oliver Riemann", class="float-right") }}</p>
|
||||
|
||||
<table class="tg">
|
||||
<tr>
|
||||
@@ -36,7 +36,7 @@ anchor = "doctors"
|
||||
***
|
||||
|
||||
<h1 id="Krey" class="anchor">Dr. med. Angela Krey</h1>
|
||||
{{ img(src="team/Angela.jpg", width=200, alt="Dr. Angela Krey", class="float-right") }}
|
||||
<p>{{ img(src="team/Angela.jpg", width=200, alt="Dr. Angela Krey", class="float-right") }}</p>
|
||||
|
||||
<table class="tg">
|
||||
<tr>
|
||||
@@ -67,7 +67,7 @@ anchor = "doctors"
|
||||
***
|
||||
|
||||
<h1 id="Malyga" class="anchor">Christian Malyga</h1>
|
||||
{{ img(src="team/Christian.jpg", width=200, alt="Christian Malyga", class="float-right") }}
|
||||
<p>{{ img(src="team/Christian.jpg", width=200, alt="Christian Malyga", class="float-right") }}</p>
|
||||
|
||||
<table class="tg">
|
||||
<tr>
|
||||
|
||||
+10
-20
@@ -1,32 +1,22 @@
|
||||
{# Image-rendering macro, used both by templates (directly via import)
|
||||
and indirectly by the `img` shortcode (which forwards to it).
|
||||
|
||||
With `width > 0`: resizes via Zola's image pipeline and emits explicit
|
||||
width/height attributes (good for large hero/preview images).
|
||||
With `width > 0`: resizes via Zola's image pipeline (file size benefit)
|
||||
but emits no width/height attributes — the theme CSS sizes the image,
|
||||
matching the live Grav site's pattern. Avoiding the HTML width attribute
|
||||
sidesteps a stretch artefact triggered by Bootstrap-3's
|
||||
`img { height: auto !important }` interacting with `.float-right`
|
||||
padding.
|
||||
|
||||
With `width = 0` (default): emits a raw <img> served from /static/images/
|
||||
with no width/height attributes — lets the theme CSS size the image, which
|
||||
matches the live Grav site's pattern. Use this for content thumbnails that
|
||||
the theme styles responsively. #}
|
||||
With `width = 0` (default): emits the raw <img> straight from
|
||||
/static/images/ — same shape, no resize. #}
|
||||
|
||||
{% macro render(src, width=0, alt="", class="") %}
|
||||
{%- set width = width | int -%}
|
||||
{%- if width > 0 -%}
|
||||
{%- set resized = resize_image(path="static/images/" ~ src, width=width, op="fit_width", quality=85) -%}
|
||||
<img
|
||||
src="{{ resized.url | safe }}"
|
||||
width="{{ resized.width }}"
|
||||
height="{{ resized.height }}"
|
||||
alt="{{ alt }}"
|
||||
{%- if class %} class="{{ class }}"{% endif %}
|
||||
loading="lazy"
|
||||
>
|
||||
<img src="{{ resized.url | safe }}" alt="{{ alt }}"{% if class %} class="{{ class }}"{% endif %} loading="lazy">
|
||||
{%- else -%}
|
||||
<img
|
||||
src="/images/{{ src | safe }}"
|
||||
alt="{{ alt }}"
|
||||
{%- if class %} class="{{ class }}"{% endif %}
|
||||
loading="lazy"
|
||||
>
|
||||
<img src="/images/{{ src | safe }}" alt="{{ alt }}"{% if class %} class="{{ class }}"{% endif %} loading="lazy">
|
||||
{%- endif -%}
|
||||
{% endmacro render %}
|
||||
|
||||
Reference in New Issue
Block a user