Your screenshot had no navigation at all: brand, three language letters, posts.
The cause is one missing button, and the CSS has been waiting for it since the
WordPress port. `main.css` hid `.site-bar__pages` below 768px and showed it
again on a class, and styled a `.site-bar__hamburger` — the panel's styles, the
button's styles and the animated ✕ were all ported, and the button itself never
was. Nothing in the theme has ever set that class. So for three phases every
phone saw the site with no menu, with every rule involved correct and every
selector pointing at an element that did not exist.
The toggle is a visually hidden checkbox immediately before the menu, with the ☰
as a `<label>` for it in the bar, and one rule doing the work. No JavaScript.
Not `<details>`, which is this project's usual answer and does not work here: on
desktop the menu has to be open and horizontal, and current Chrome hides a
closed `<details>`'s content with `content-visibility` on `::details-content`,
which a `display` rule on the child no longer overrides. A checkbox behaves the
same in every engine, keeps its place in the tab order and keeps its label.
`test_templates.py` now fails if the stylesheet hides the menu behind a state
the header does not carry — the shape of bug this suite keeps meeting, and the
first time it is guarded rather than found by looking.
**Comunidad is a button in the bar** at every width, brand-coloured through the
tokens Marca writes, instead of a word in a menu that on a phone would not open.
Its three translations moved from the `menus.main` blocks into `t.html`: the URL
is the same in every language, so the menu entry was only carrying a label. The
language switcher is rendered twice, in the bar and at the foot of the panel —
a brand, a button, a ☰ and three language letters do not fit across 360px and
CSS cannot move an element between the two.
**Categories and tags are gone**, both taxonomies. Nothing downstream had to
change: the agenda, the event page, the .ics and the private calendar already
keyed on `event_date` rather than on the category, which I checked before
removing anything. The category was only a gate in the editor, so the gate goes
too — **a post carrying a date is an event**, with nothing to tick first and no
way left to say "this is an event" and then not say when. Migration 6 drops the
two columns that held the terms.
`taxonomies: {}` rather than no `taxonomies` key: leaving the key out restores
Hugo's own defaults, which are tags and categories, so deleting the block built
the very pages it was meant to remove.
Also here, found while looking at the output rather than assumed: the breadcrumb
schema emitted a subpage's parent and the page itself both at position 2, and
the members area's six-section nav had no wrap and no scroll, so `/comunidad/`
on a phone scrolled sideways. It wraps now — two lines showing all six, where a
swipe strip would have left Calendario and Gestión off the edge with nothing to
say they were there.
Verified by rendering: headless Chromium at 320px, 390px and 1280px, before and
after opening the menu, and the members area at 390px. No horizontal overflow at
any of them. 548 tests pass; the build is clean with the pipeline's own flags.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NizVpJ2dwzCbjCrTLCjeHn
144 lines
6.2 KiB
HTML
144 lines
6.2 KiB
HTML
{% extends "base.html" %}
|
|
{% block title %}{{ 'Editar' if item else 'Nuevo' }} {{ meta.singular|lower }}{% endblock %}
|
|
|
|
{% set f = fields or {} %}
|
|
|
|
{% block main %}
|
|
{% if preview_html %}
|
|
<article class="card">
|
|
<div class="card__meta"><span class="tag tag--quiet">Vista previa</span></div>
|
|
<h1 class="card__title">{{ f.title }}</h1>
|
|
<div class="prose">{{ preview_html }}</div>
|
|
</article>
|
|
{% endif %}
|
|
|
|
<form class="card" method="post" enctype="multipart/form-data"
|
|
action="{{ url_for('content.edit', collection=collection, name=item.name) if item
|
|
else url_for('content.new', collection=collection) }}">
|
|
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
|
|
{% if item %}
|
|
<input type="hidden" name="sha" value="{{ item.sha }}">
|
|
<input type="hidden" name="name" value="{{ item.name }}">
|
|
{% endif %}
|
|
{# The byline travels with the document, like the date and the image path.
|
|
An edit keeps whoever wrote it; only publishing sets it. #}
|
|
{% if f and f.author %}
|
|
<input type="hidden" name="author" value="{{ f.author }}">
|
|
<input type="hidden" name="author_url" value="{{ f.author_url or '' }}">
|
|
{% endif %}
|
|
|
|
<h1>{{ ('Editar ' ~ meta.singular|lower) if item else meta.new_label }}</h1>
|
|
|
|
<label for="title">Título</label>
|
|
<input id="title" name="title" maxlength="140" required value="{{ f.title or '' }}">
|
|
|
|
{% if meta.dated %}
|
|
<label for="date">Fecha</label>
|
|
<input id="date" name="date" type="date" required value="{{ f.date or today }}">
|
|
{% endif %}
|
|
|
|
{% if collection == 'page' %}
|
|
{# Where this page sits in the public menu. The menu is built from the pages
|
|
themselves, so a page published here appears on the site by itself —
|
|
choosing a parent puts it in the submenu under that page instead of on the
|
|
top row. The choice is made once and holds in the three languages. #}
|
|
<label for="parent">En el menú</label>
|
|
{% set names = parents | map(attribute='base') | list %}
|
|
<select id="parent" name="parent">
|
|
<option value="">En la barra principal</option>
|
|
{% if f.parent and f.parent not in names %}
|
|
{# The page it hung under has been deleted, or the git server could not be
|
|
reached to list them. Either way the relationship is kept and said out
|
|
loud, rather than dropped silently by the next save. #}
|
|
<option value="{{ f.parent }}" selected>Dentro de «{{ f.parent }}» (no encontrada)</option>
|
|
{% endif %}
|
|
{% for other in parents %}
|
|
<option value="{{ other.base }}" {{ 'selected' if f.parent == other.base }}>
|
|
Dentro de «{{ other.title }}»
|
|
</option>
|
|
{% endfor %}
|
|
</select>
|
|
|
|
<label for="weight">Orden</label>
|
|
<input id="weight" name="weight" type="number" min="0" max="999"
|
|
value="{{ f.weight or 50 }}">
|
|
<p class="muted small">Menor número, más a la izquierda. 50 si da igual.</p>
|
|
{% endif %}
|
|
|
|
{% if collection == 'post' %}
|
|
{# An event's own date, which is not the day the post goes up. The date is
|
|
also what makes this post an event: there is nothing to tick first, so
|
|
there is no way to say "this is an event" and then not say when. #}
|
|
<fieldset class="fieldset">
|
|
<legend>Si es un evento</legend>
|
|
<p class="muted small">
|
|
Pon la fecha y será un evento: aparecerá en la agenda del sitio, con el
|
|
día y el lugar destacados, y se podrá añadir al calendario del móvil.
|
|
Déjala vacía y es un artículo normal.
|
|
</p>
|
|
|
|
<label for="event_date">Fecha del evento</label>
|
|
<input id="event_date" name="event_date" type="date" value="{{ f.event_date or '' }}">
|
|
|
|
<label for="event_time">Hora <span class="muted small">(opcional)</span></label>
|
|
<input id="event_time" name="event_time" type="time" value="{{ f.event_time or '' }}">
|
|
<p class="muted small">Déjala vacía si dura todo el día.</p>
|
|
|
|
<label for="event_location">Lugar <span class="muted small">(opcional)</span></label>
|
|
<input id="event_location" name="event_location" maxlength="200"
|
|
value="{{ f.event_location or '' }}">
|
|
<p class="muted small">Dónde es: el sitio, la calle, el barrio.</p>
|
|
</fieldset>
|
|
|
|
<label for="description">Resumen</label>
|
|
<textarea id="description" name="description" rows="2">{{ f.description or '' }}</textarea>
|
|
<p class="muted small">
|
|
Una o dos frases que se entiendan solas: es lo que aparece en los
|
|
listados, en WhatsApp al compartir el enlace y lo que citan los
|
|
buscadores. Mejor concreta («El sábado 12 en Ottakring») que general.
|
|
</p>
|
|
|
|
<label for="picture">Imagen destacada</label>
|
|
{% if f.image %}
|
|
<p class="muted small">Actual: <span class="mono">{{ f.image }}</span> — sube otra para reemplazarla.</p>
|
|
<input type="hidden" name="image" value="{{ f.image }}">
|
|
{% endif %}
|
|
<input id="picture" name="picture" type="file" accept="image/*">
|
|
|
|
<label for="image_alt">Texto alternativo de la imagen</label>
|
|
<input id="image_alt" name="image_alt" maxlength="200" value="{{ f.image_alt or '' }}">
|
|
<p class="muted small">
|
|
Qué se ve en la foto, en una frase. Lo lee quien no puede ver la imagen y
|
|
lo leen también los buscadores.
|
|
</p>
|
|
{% endif %}
|
|
|
|
<label for="body">Cuerpo</label>
|
|
<textarea id="body" data-markdown name="body" rows="18" required
|
|
placeholder="Markdown: **negrita**, ## títulos, listas, [enlaces](https://…).">{{ body }}</textarea>
|
|
|
|
<label for="faq">Preguntas frecuentes <span class="muted small">(opcional)</span></label>
|
|
<textarea id="faq" name="faq" rows="5"
|
|
placeholder="¿Dónde es?|En la plaza de Ottakring, junto al mercado.">{{ f.faq or '' }}</textarea>
|
|
<p class="muted small">
|
|
Una por línea, con el formato <span class="mono">pregunta|respuesta</span>.
|
|
Se muestran al final de la página y son lo que mejor citan los buscadores
|
|
y los asistentes de IA: pregunta concreta, respuesta corta y verificable.
|
|
</p>
|
|
|
|
<label class="check">
|
|
<input type="checkbox" name="manual_translation" {{ 'checked' if f.manual_translation }}>
|
|
Traducción manual — no generar alemán ni portugués para esto
|
|
</label>
|
|
|
|
<div class="actions">
|
|
<button class="btn" type="submit">{{ 'Guardar' if item else 'Publicar' }}</button>
|
|
<button class="linkish" type="submit"
|
|
formaction="{{ url_for('content.preview', collection=collection) }}">
|
|
Vista previa
|
|
</button>
|
|
<a class="linkish" href="{{ url_for('content.index', collection=collection) }}">Cancelar</a>
|
|
</div>
|
|
</form>
|
|
{% endblock %}
|