feat: i18n template infrastructure — render.sh reads _en vars, emits data-de/data-en
Phase 1 of i18n rollout: - render.sh: i18n_attrs helper, reads *_en fields from site.yaml, emits data-de/data-en attributes on title, description, role, tagline, cta, tags, section titles, card titles/descriptions, bio, content - base.html: i18n.js auto-included, title/description get i18n attrs - All 6 templates: translatable elements get i18n attr placeholders, footer toggle button with machine-translation disclaimer - ichbinotto.de pilot: added machine-translation disclaimer per m's request Templated sites can now be translated by adding _en fields to site.yaml.
This commit is contained in:
@@ -95,18 +95,21 @@
|
||||
{{template_body_start}}
|
||||
<div class="container">
|
||||
<div class="hero fade-in">
|
||||
<h1>{{title}}</h1>
|
||||
<div class="subtitle">{{tagline}}</div>
|
||||
<h1{{title_i18n}}>{{title}}</h1>
|
||||
<div class="subtitle"{{tagline_i18n}}>{{tagline}}</div>
|
||||
</div>
|
||||
|
||||
{{sections_html}}
|
||||
|
||||
<div class="cta-section fade-in stagger-4">
|
||||
<a href="{{cta_href}}" class="cta">{{cta_text}}</a>
|
||||
<a href="{{cta_href}}" class="cta"{{cta_i18n}}>{{cta_text}}</a>
|
||||
</div>
|
||||
|
||||
<div class="footer fade-in stagger-5">
|
||||
© {{year}} {{name}}
|
||||
<br>
|
||||
<button data-i18n-toggle title="Maschinell übersetzt / Machine-translated — German is the original." style="background:none;border:1px solid currentColor;color:var(--text-dimmed,#888);font-size:0.65rem;letter-spacing:0.1em;padding:4px 12px;border-radius:4px;cursor:pointer;margin-top:12px;opacity:0.6;">EN</button>
|
||||
<br><small data-de="Maschinell übersetzt" data-en="Machine-translated" style="color:var(--text-dimmed,#888);font-size:0.6rem;opacity:0.5;">Maschinell übersetzt</small>
|
||||
</div>
|
||||
</div>
|
||||
{{template_body_end}}
|
||||
|
||||
Reference in New Issue
Block a user