Hero blank-band bug (root cause):
- The hero override read styled-text fields as `field.text|default:field`
(eyebrow/headline/subheadline/description). The ninjatpl engine hard-errors
on attribute-access-against-a-bare-string, and the demo seed passes these
fields as bare strings, so the whole hero errored and rendered as an empty
~75vh band on the landing page. Switched to `field|get:"text"|default:field`
— the process-global `get` filter degrades gracefully on a bare string
(returns nothing, so `|default:` falls back to the string) and still reads
`.text` from the admin/editor `{text,color}` object form. Matches the fixed
sibling lanes (terminal, scifi-clean). navbar `cta.text` left as-is: that
field is always a link object, never a bare string (terminal did the same).
Whitespace pass:
- Trimmed oversized marketing section padding py-16 md:py-24 -> py-12 md:py-20
across 15 blocks (cta, feature-grid, pricing, stats, team, testimonial,
timeline, faq, countdown, rich-section, contact-card, contact-form,
event-list, menu-list, hours-location) to remove dead inter-section bands.
Tailwind classes only — the host Tailwind build now scans theme .ninjatpl,
so responsive utilities compile; no duplicate hand-rolled media-query CSS
added.
No new CSS (earthen's manifest CSS is all bespoke aesthetic — nothing
duplicated a utility). No scroll-reveal system exists to harden; the stats
count-up already no-ops under reduced-motion / no-JS and renders final values.
Codeless build OK (earthen@0.2.1). check-safety: 32 checks 19 ok 13 skip -> OK.
No version bump.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
40 lines
5.2 KiB
Plaintext
40 lines
5.2 KiB
Plaintext
{# hero override — earthen: paper-grain ground, botanical eyebrow rule, Fraunces headline, soft organic media. All {% set %}, {% img %} calls, overlay conditional layers, the herocontent macro and variant branches preserved verbatim from the builtin; only classes/style/fonts/copy reskinned. Styled-text fields accept {text,color} or a bare string. #}
|
|
{% set eyebrowText = eyebrow|get:"text"|default:eyebrow %}
|
|
{% set headlineText = headline|get:"text"|default:headline %}
|
|
{% set subText = subheadline|get:"text"|default:subheadline %}
|
|
{% set descText = description|get:"text"|default:description %}
|
|
{% set pText = ctaPrimary.text %}
|
|
{% set pUrl = ctaPrimary.url %}
|
|
{% set sText = ctaSecondary.text %}
|
|
{% set sUrl = ctaSecondary.url %}
|
|
{% set variant = template|default:"centered" %}
|
|
{% set hasImage = backgroundImage %}
|
|
{% set showOverlay = hasImage and overlayColor != "none" and overlayColor != "" %}
|
|
{% macro herocontent(align) %}
|
|
{% if eyebrowText %}<div class="mb-5 flex items-center gap-3 {% if align == "center" %}justify-center{% endif %}"><span class="h-px w-8" style="background-color:hsl(var(--accent));"></span><span class="text-xs font-semibold uppercase tracking-wider" style="font-family:var(--font-body, 'Work Sans', ui-sans-serif, system-ui, sans-serif);color:hsl(var(--primary));">{{ eyebrowText }}</span><span class="h-px w-8" style="background-color:hsl(var(--accent));"></span></div>{% endif %}
|
|
{% if headlineText %}<h1 class="text-4xl sm:text-5xl lg:text-6xl font-semibold leading-tight" style="font-family:var(--font-heading, 'Fraunces', 'Playfair Display', Georgia, serif);color:hsl(var(--primary));">{{ headlineText }}</h1>{% endif %}
|
|
{% if subText %}<h2 class="mt-5 text-xl sm:text-2xl max-w-2xl{% if align == "center" %} mx-auto{% endif %}" style="color:hsl(var(--muted-foreground));font-family:var(--font-body, 'Work Sans', ui-sans-serif, system-ui, sans-serif);">{{ subText }}</h2>{% endif %}
|
|
{% if descText %}<p class="mt-4 max-w-xl leading-relaxed{% if align == "center" %} mx-auto{% endif %}" style="color:hsl(var(--muted-foreground));">{{ descText }}</p>{% endif %}
|
|
{% if pText or sText %}<div class="mt-8 flex flex-col sm:flex-row gap-4{% if align == "center" %} justify-center{% endif %}">
|
|
{% if pText and pUrl %}<a href="{{ pUrl }}" class="earthen-cta inline-flex items-center justify-center gap-2 px-6 py-3 font-semibold">{{ pText }}</a>{% endif %}
|
|
{% if sText and sUrl %}<a href="{{ sUrl }}" class="inline-flex items-center justify-center rounded-lg px-6 py-3 font-semibold transition-colors hover:bg-muted" style="border:1.5px solid hsl(var(--border));color:hsl(var(--primary));">{{ sText }}</a>{% endif %}
|
|
</div>{% endif %}
|
|
{% if trustLogos %}<div class="mt-10">
|
|
<p class="text-xs uppercase tracking-wider mb-3" style="color:hsl(var(--muted-foreground));">In good company</p>
|
|
<div class="flex flex-wrap items-center gap-6{% if align == "center" %} justify-center{% endif %}">{% for logo in trustLogos %}{% if logo.url %}<a href="{{ logo.url }}" target="_blank" rel="noopener noreferrer" class="opacity-60 transition-opacity hover:opacity-100">{% img logo.image alt=logo.alt class="h-8 w-auto" %}</a>{% else %}{% img logo.image alt=logo.alt class="h-8 w-auto opacity-60" %}{% endif %}{% endfor %}</div>
|
|
</div>{% endif %}
|
|
{% endmacro %}
|
|
{% if variant == "split" %}
|
|
<section data-block-override="earthen:hero" class="hero grid grid-cols-1 lg:grid-cols-2 overflow-hidden bg-background text-foreground{% if class %} {{ class }}{% endif %}">
|
|
<div class="relative min-h-[320px] bg-muted bg-paper-grain {% if mediaPosition == "left" %}order-1 lg:order-1{% else %}order-1 lg:order-2{% endif %}">{% if hasImage %}{% img backgroundImage alt=headlineText class="absolute inset-0 h-full w-full object-cover" layout="hero" %}{% endif %}</div>
|
|
<div class="flex flex-col justify-center px-6 py-16 lg:px-12 {% if mediaPosition == "left" %}order-2 lg:order-2{% else %}order-2 lg:order-1{% endif %}"><div class="max-w-lg text-left">{{ herocontent("left") }}</div></div>
|
|
</section>
|
|
{% else %}
|
|
{% set align = "center" %}
|
|
{% if variant == "left-aligned" %}{% set align = "left" %}{% endif %}
|
|
<section data-block-override="earthen:hero" class="hero relative flex flex-col overflow-hidden bg-background text-foreground bg-paper-grain {% if minHeight == "screen" %}min-h-screen{% elif minHeight == "50vh" %}min-h-[50vh]{% elif minHeight == "auto" %}min-h-[400px]{% else %}min-h-[75vh]{% endif %} {% if verticalAlign == "top" %}justify-start pt-20{% elif verticalAlign == "bottom" %}justify-end pb-20{% else %}justify-center{% endif %}{% if class %} {{ class }}{% endif %}">
|
|
{% if hasImage %}<div class="absolute inset-0 z-0">{% img backgroundImage alt=headlineText class="h-full w-full object-cover" layout="hero" %}{% if showOverlay %}<div class="absolute inset-0 {% if overlayColor == "light" %}bg-background/60{% elif overlayColor == "primary" %}bg-primary/50{% elif overlayOpacity <= 30 %}bg-black/30{% elif overlayOpacity <= 50 %}bg-black/50{% elif overlayOpacity <= 70 %}bg-black/70{% else %}bg-black/80{% endif %}"></div>{% endif %}</div>{% endif %}
|
|
<div class="relative z-10 mx-auto w-full max-w-4xl px-4 sm:px-6 lg:px-8 {% if variant == "left-aligned" %}text-left{% else %}text-center{% endif %}">{{ herocontent(align) }}</div>
|
|
</section>
|
|
{% endif %}
|