vienalatina/config.yaml
Claude 8e1ef8831c
The writing box shows the formatting, and raw HTML stops reaching the site
The box is now the finished text: bold is bold, a heading is a heading, a
list is a list. No preview pane — a second box beside the first is the
wrong shape on a phone — and nothing is sent anywhere while anybody
types, so the round trip the old «Vista previa» button made on every
press is gone.

Markdown is still the only thing stored, which is what keeps the file in
git, the translation pipeline, Decap and the XSS defence exactly as they
were. The two directions are deliberately not symmetrical:

  opening  — the server renders the stored markdown into a <template>
             the editor adopts, so there is no markdown parser in the
             browser and no second opinion about what text means;
  saving   — the browser walks a closed set of elements back into
             markdown. Anything else contributes its text and nothing
             more, which is why a paste brings no markup in.

Three heading levels (## ### ####), bold, italic, strikethrough, two
kinds of list, quote, link and clear formatting on the four post boxes;
bold, italic, link and clear on the short ones. A «Markdown» button
swaps to the raw text and back — the escape hatch, and the way to write
a table. With JavaScript off the plain textarea is still there and still
the field that submits; verified by driving the form with scripting
disabled.

Headings had no styles anywhere. `.article-single__body` styled `p` and
nothing else, so three levels would have rendered as three identical
bold lines. Both stylesheets now carry the ladder, along with lists,
quotes and rules.

Two renderer findings, both of which richer writing makes worse:

  - config.yaml set Goldmark `unsafe: true`, for WordPress content that
    no longer exists — no file under content/ holds a tag. A member's
    proposal containing `<img src=x onerror=…>` renders as visible
    characters in the moderation queue, which is the one screen a
    moderator judges it on, and that flag is what would have run it on
    the live site. Off now; the built output is byte-identical.
  - A line break meant two things: `breaks: True` here, Goldmark's
    hardWraps off there. Turning hardWraps on was the obvious fix and
    the wrong one — the files are hard-wrapped at 78 characters, so it
    would break every sentence in half. Instead there are two renderers,
    one per destination, and the editor writes the hard break CommonMark
    means (two spaces) so it survives either way.

Tested by running the serializer itself, in node, against the same
static/board.js the browser loads: 26 cases including the ones that go
wrong — a pasted span, a script, an empty box, a line starting with «-»,
a javascript: href — plus a round trip asserting markdown → HTML →
markdown renders identically for ten real documents.

Then by typing in a browser at 390px with touch emulation, which is what
found the one defect no fixture predicted: pressing Enter in a list
wraps it in a <div>, and reading that as a paragraph ran «uno» and «dos»
together into one word.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NizVpJ2dwzCbjCrTLCjeHn
2026-10-06 20:07:18 +00:00

138 lines
5.3 KiB
YAML

# Viena Latina — Hugo site configuration
# Three languages: Spanish (default, at /), German (/de/), Brazilian Portuguese (/pt-br/).
# Siblings pair by filename basename: mi-articulo.es.md ↔ mi-articulo.de.md ↔ mi-articulo.pt-br.md
baseURL: "https://vienalatina.com/"
title: "Viena Latina"
theme: "vienalatina"
defaultContentLanguage: "es"
defaultContentLanguageInSubdir: false
# Date-scoped so two posts can share a title without fighting over one URL.
# `:slug` falls back to the title when front matter sets none, so a bare
# "/:slug/" mapped every post called "Hola mundo" onto /hola-mundo/; Hugo wrote
# both documents into that one index.html and the page rendered as two stacked
# copies of the site, with no error anywhere. Community blogs repeat titles
# constantly ("Resumen del mes"), so the date carries the uniqueness. The day is
# part of it because the two posts that exposed this were eleven days apart in
# the same month; only same-title-same-day now collides, and the build guard in
# .woodpecker.yml fails that loudly instead of shipping it.
permalinks:
post: "/:year/:month/:day/:slug/"
# No taxonomies. An empty map rather than no `taxonomies` key at all: 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. This turns
# them off, and /categories/… and /tags/ fall through to the site's 404.
taxonomies: {}
languages:
es:
languageCode: "es"
languageName: "Español"
weight: 1
params:
description: "Comunidad latinoamericana en Viena — turismo, cultura, gastronomía, comunidad y comercio."
# Only Inicio lives here. Everything after it is built from the pages
# themselves by partials/header.html — so a page published from the members
# area appears on the site, with its own translated title, instead of
# needing three edits in this file. Weight decides the side: under 5 goes
# before the pages, 5 or more after them.
#
# Comunidad used to be the entry at weight 9. It is a button in the header
# bar now rather than a word in the menu, so its three translations live in
# partials/t.html — the URL is the same in every language, and a menu entry
# was only ever carrying the label.
menus:
main:
- name: "Inicio"
url: "/"
weight: 1
de:
languageCode: "de"
languageName: "Deutsch"
weight: 2
params:
description: "Lateinamerikanische Community in Wien — Tourismus, Kultur, Gastronomie, Gemeinschaft und Handel."
menus:
main:
- name: "Start"
url: "/de/"
weight: 1
pt-br:
languageCode: "pt-BR"
languageName: "Português (Brasil)"
weight: 3
params:
description: "Comunidade latino-americana em Viena — turismo, cultura, gastronomia, comunidade e comércio."
menus:
main:
- name: "Início"
url: "/pt-br/"
weight: 1
params:
# The picture a share card falls back on when a post or page has none, and the
# organisation's logo in the structured data.
#
# **The logo uploaded in Gestión → Marca is used first**, so this is now only
# for a site that wants a different share picture from its logo — a photo of
# the city, say. One path (/uploads/algo.png) and WhatsApp, Signal, Mastodon
# and Bluesky all start showing an image. Empty, with no logo either, means a
# link shares as title and description.
defaultImage: ""
# The organisation's profiles elsewhere, for `sameAs` in the Organization
# schema: it is how a search or answer engine knows the Instagram account and
# this site are the same body. One URL per line when they exist.
sameAs: []
# og:locale values per language slug (ported from theme/inc/seo.php).
localeMap:
es: "es_ES"
de: "de_DE"
pt-br: "pt_BR"
# llms.txt — custom plain-text output rendered from layouts/index.llms.txt
# (ported from theme/inc/robots-and-llms.php).
outputFormats:
llms:
mediaType: "text/plain"
baseName: "llms"
isPlainText: true
# One .ics beside an event's page, so "añadir a mi calendario" is a link and
# not an instruction. Only pages whose frontmatter lists this output generate
# one, and the editor writes that line for a post in the Evento category —
# see apps/board/content.py.
ics:
mediaType: "text/calendar"
baseName: "index"
isPlainText: true
outputs:
home: ["HTML", "RSS", "llms"]
sitemap:
changefreq: "weekly"
priority: 0.5
markup:
goldmark:
renderer:
# Raw HTML in a post is not rendered as HTML. It was on, for content
# migrated from WordPress that carried inline markup; that content is
# gone — no file under content/ holds a single tag — and leaving it on
# had a cost that grew with the members area: a proposal written by a
# member is rendered here with `html=False`, so a moderator reviewing
# `<img src=x onerror=…>` sees the characters and approves them, and
# this flag is what would have run them on the live site.
#
# hardWraps is deliberately left off: the files are hard-wrapped at
# about 78 characters, so turning it on would break every sentence in
# half. apps/board/render.py says how the two renderers are kept
# honest about that.
unsafe: false
enableRobotsTXT: false # robots.txt is a static file in static/