4 Commits
Author SHA1 Message Date
itziarZG a06316dade feat(seo): custom news sitemap with per-aviso news blocks
ci / build-and-test (push) Canceled after 0s
Replace the @astrojs/sitemap integration with two handwritten endpoints
under src/pages/ so we can attach a Google News <news:news> block to each
aviso detail URL. The integration already emitted the news namespace
but never the per-URL blocks, so the project was not eligible for
Google News indexing.

- src/pages/sitemap-index.xml.ts: single-child sitemapindex pointing at
  /sitemap-0.xml.
- src/pages/sitemap-0.xml.ts: home + huella + one entry per aviso from
  getAvisosAmbientales. Each aviso carries <news:news> with
  publication name (fuente), language ca, publication_date (ISO),
  title and keywords (temas joined).
- astro.config.mjs: drop the @astrojs/sitemap integration; remove the
  dependency from package.json and pnpm-lock.yaml.
- e2e: add a test asserting the news namespace and at least one
  <news:news> block with publication_date and language. 22/22 e2e
  pass; check and eslint clean.
2026-07-26 22:27:32 +02:00
itziarZG 0abbd77828 feat(seo): per-aviso OG images generated at build
ci / build-and-test (push) Canceled after 0s
scripts/build-og-image.ts (renamed from .mjs, run via tsx) now also
queries getAvisosAmbientales and rasterizes a 1200x630 PNG per aviso at
public/og/avis/[origen]-[id].png. The SVG is built inline from the aviso
fields: title (truncated to 110 chars), summary (200), source and
municipio as meta line. [slug].astro passes /og/avis/<slug>.png + the
title as alt to BaseLayout, which emits og:image, og:image:alt,
twitter:image and twitter:image:alt automatically.

e2e: detail page test now also asserts og:image points at the per-aviso
PNG and that the PNG returns 200. 20/20 e2e pass; check and eslint
clean.
2026-07-26 22:15:52 +02:00
itziarZG 743bbbb495 feat: per-aviso detail pages with NewsArticle JSON-LD
ci / build-and-test (push) Canceled after 0s
Generate a static page per aviso at /avis/[origen]-[id] using getStaticPaths
from getAvisosAmbientales. Each page carries a NewsArticle JSON-LD node
(headline, description, datePublished, inLanguage, isAccessibleForFree,
keywords, author, publisher, mainEntityOfPage) and renders the title,
metadata, temas, summary and a 'font original' aside pointing at the
external source (rel=noopener noreferrer, target=_blank, with a
visually-hidden SR cue). EntryCard keeps the external link as the primary
action and gains an inline 'Llegir més' link to the internal detail.

e2e coverage:
- detail page renders H1 and external link
- JSON-LD parses and includes Organization, WebSite and NewsArticle with
  the expected metadata
- every URL listed in sitemap-0.xml under /avis/ returns 200

Sitemap now lists the 6 fixture avisos as canonical URLs. JSON-LD
selectors are scoped to head to avoid inline scripts in the body.
20/20 e2e pass; astro check and eslint clean.
2026-07-26 22:10:20 +02:00
itziarZG c492e5e214 test(e2e): add Playwright + axe-core smoke suite
Add @playwright/test, axe-core and @axe-core/playwright as devDependencies.

- playwright.config.ts with desktop+mobile projects and a webServer that boots astro preview on 127.0.0.1:4321.
- tests/e2e/site.spec.ts covers: home renders with H1 and textual map summary; skip-link is the first focusable and jumps to main; filter pills toggle aria-pressed and update the live counter; 404 is noindex; JSON-LD parses and exposes Organization+WebSite+ItemList; robots.txt and sitemap are wired to Astro.site; the 404 is excluded from the sitemap; the generated og-default.png is 1200x630.
- Scripts: test:e2e runs the suite, test:e2e:install pulls the chromium headless shell.
- .gitignore ignores test-results/, playwright-report/ and the playwright cache.

All 16 tests pass (8 desktop, 8 mobile).
2026-07-26 21:37:00 +02:00