Просмотр исходного кода

feat(web): changelog page generated from the release archive

Nacho 1 неделя назад
Родитель
Сommit
5655024534
14 измененных файлов с 608 добавлено и 5 удалено
  1. 4 0
      web/app.js
  2. 144 0
      web/build-changelog.mjs
  3. 20 5
      web/build-langs.mjs
  4. 178 0
      web/changelog.html
  5. 114 0
      web/changelog.template.html
  6. 1 0
      web/features.html
  7. 1 0
      web/home-assistant.html
  8. 60 0
      web/i18n.js
  9. 1 0
      web/index.html
  10. 1 0
      web/integrations.html
  11. 4 0
      web/sitemap.xml
  12. 3 0
      web/src/app.ts
  13. 60 0
      web/src/i18n.ts
  14. 17 0
      web/styles.css

+ 4 - 0
web/app.js

@@ -1409,6 +1409,10 @@ function initAppearance() {
     updateAppearancePanel();
     const fab = document.getElementById('appFab');
     const panel = document.getElementById('appPanel');
+    // Páginas sin el panel de apariencia (el changelog, #2148) no lo tienen: el
+    // tema guardado se sigue aplicando arriba, solo se salta el control.
+    if (!fab || !panel)
+        return;
     fab.addEventListener('click', () => { panel.classList.toggle('open'); fab.setAttribute('aria-expanded', String(panel.classList.contains('open'))); });
     document.addEventListener('click', e => { if (!panel.contains(e.target) && !fab.contains(e.target))
         panel.classList.remove('open'); });

+ 144 - 0
web/build-changelog.mjs

@@ -0,0 +1,144 @@
+// build-changelog.mjs — genera web/changelog.html con todas las releases.
+//
+// Fuente: docs/releases/<version>.md (curadas) y docs/releases/archive/*.md
+// (histórico, cuerpo verbatim). Los cuerpos están en inglés, que es la norma
+// de las notas desde 2.54.0; la página y su navegación van traducidas por el
+// runtime de la landing como cualquier otra.
+//
+// Uso (desde web/):  node build-changelog.mjs
+// Después:           npm run build:langs   (prerender es/en/zh/ru)
+import { readFile, writeFile, readdir } from 'node:fs/promises'
+import path from 'node:path'
+import { fileURLToPath } from 'node:url'
+
+const WEB = path.dirname(fileURLToPath(import.meta.url))
+const ROOT = path.dirname(WEB)
+const ARCHIVE = path.join(ROOT, 'docs', 'releases', 'archive')
+const CURATED = path.join(ROOT, 'docs', 'releases')
+const CARD_LANGS = ['es', 'en', 'zh', 'ru']
+
+const esc = (s) => s.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;')
+
+/** Markdown mínimo para el subconjunto que usan las notas. */
+function md(src) {
+  const lines = src.replace(/\r\n/g, '\n').split('\n')
+  const out = []
+  let list = null
+  let code = false
+  const flush = () => {
+    if (list) {
+      out.push(`<${list.tag}>${list.items.join('')}</${list.tag}>`)
+      list = null
+    }
+  }
+  const inline = (t) =>
+    esc(t)
+      .replace(/`([^`]+)`/g, '<code>$1</code>')
+      .replace(/\*\*([^*]+)\*\*/g, '<strong>$1</strong>')
+      .replace(/!\[([^\]]*)\]\(([^)]+)\)/g, '$1')
+      .replace(/\[([^\]]+)\]\(([^)]+)\)/g, '<a href="$2">$1</a>')
+
+  for (const raw of lines) {
+    const line = raw.replace(/\s+$/, '')
+    if (line.startsWith('```')) {
+      flush()
+      out.push(code ? '</pre>' : '<pre>')
+      code = !code
+      continue
+    }
+    if (code) {
+      out.push(esc(raw))
+      continue
+    }
+    if (!line.trim()) {
+      flush()
+      continue
+    }
+    const h = line.match(/^(#{1,4})\s+(.*)$/)
+    if (h) {
+      flush()
+      const level = Math.min(h[1].length + 2, 6)
+      out.push(`<h${level}>${inline(h[2])}</h${level}>`)
+      continue
+    }
+    if (/^---+$/.test(line.trim())) {
+      flush()
+      out.push('<hr />')
+      continue
+    }
+    const ul = line.match(/^\s*[-*]\s+(.*)$/)
+    const ol = line.match(/^\s*\d+\.\s+(.*)$/)
+    if (ul || ol) {
+      const tag = ul ? 'ul' : 'ol'
+      if (!list || list.tag !== tag) {
+        flush()
+        list = { tag, items: [] }
+      }
+      list.items.push(`<li>${inline((ul ?? ol)[1])}</li>`)
+      continue
+    }
+    flush()
+    out.push(`<p>${inline(line)}</p>`)
+  }
+  flush()
+  if (code) out.push('</pre>')
+  return out.join('\n')
+}
+
+async function load() {
+  const releases = []
+  const seen = new Set()
+
+  // Curadas primero (las que llevan notas nuevas): <version>.md sin la v.
+  for (const f of await readdir(CURATED)) {
+    if (!/^\d+\.\d+\.\d+\.md$/.test(f)) continue
+    const version = f.replace(/\.md$/, '')
+    const body = await readFile(path.join(CURATED, f), 'utf8')
+    releases.push({ tag: `v${version}`, version, body, curated: true })
+    seen.add(version)
+  }
+
+  // Histórico: nombres vX.Y.Z.md y go-latest/dist-latest.
+  for (const f of await readdir(ARCHIVE)) {
+    if (!f.endsWith('.md') || f === 'INDEX.md') continue
+    const tag = f.replace(/\.md$/, '')
+    const version = tag.replace(/^v/, '').replace(/-\d+$/, '')
+    if (seen.has(version)) continue
+    const body = await readFile(path.join(ARCHIVE, f), 'utf8')
+    releases.push({ tag, version, body, curated: false })
+  }
+
+  const key = (v) => v.split('.').map((n) => Number.parseInt(n, 10) || 0)
+  releases.sort((a, b) => {
+    const ka = key(a.version)
+    const kb = key(b.version)
+    for (let i = 0; i < Math.max(ka.length, kb.length); i++) {
+      const d = (kb[i] ?? 0) - (ka[i] ?? 0)
+      if (d !== 0) return d
+    }
+    return 0
+  })
+  return releases
+}
+
+const list = await load()
+const template = await readFile(path.join(WEB, 'changelog.template.html'), 'utf8')
+
+const html = list
+  .map((r, i) => {
+    const open = i === 0 ? ' open' : ''
+    return `<details class="changelog-entry"${open}>
+  <summary><span class="changelog-tag">${esc(r.tag)}</span><span class="changelog-arrow" aria-hidden="true">▾</span></summary>
+  <div class="changelog-body">
+${md(r.body)}
+  </div>
+</details>`
+  })
+  .join('\n')
+
+const out = template
+  .replace('<!--RELEASES-->', html)
+  .replace('<html lang="es">', `<html lang="es" data-changelog-langs="${CARD_LANGS.join(',')}">`)
+
+await writeFile(path.join(WEB, 'changelog.html'), out)
+console.log(`changelog.html: ${list.length} releases, ${(out.length / 1024).toFixed(0)} KiB`)

+ 20 - 5
web/build-langs.mjs

@@ -17,6 +17,8 @@ const WEB = path.dirname(fileURLToPath(import.meta.url))
 const OUT = path.join(WEB, 'langs')
 const BASE = 'https://netpulse.cloudless.club'
 const LANGS = ['es', 'en', 'zh', 'ar', 'hi', 'pt', 'fr', 'ja', 'ru', 'de']
+// Idiomas con página de changelog (#2148). El resto del sitio enlaza a /en/.
+const CHANGELOG_LANGS = ['es', 'en', 'zh', 'ru']
 // BCP-47 para og:locale de cada idioma prerenderizado.
 const OG_LOCALE = {
   es: 'es_ES', en: 'en_US', zh: 'zh_CN', ar: 'ar_SA', hi: 'hi_IN',
@@ -29,6 +31,9 @@ const PAGES = [
   { file: 'features.html', slug: 'features/', esSlug: 'features', outDir: 'features' },
   { file: 'home-assistant.html', slug: 'home-assistant/', esSlug: 'home-assistant', outDir: 'home-assistant' },
   { file: 'integrations.html', slug: 'integrations/', esSlug: 'integrations', outDir: 'integrations' },
+  // Changelog (#2148): solo en los idiomas de la app. El resto del sitio
+  // enlaza a /en/changelog/ y el selector cae a la home del idioma elegido.
+  { file: 'changelog.html', slug: 'changelog/', esSlug: 'changelog', outDir: 'changelog', langs: ['es', 'en', 'zh', 'ru'] },
 ]
 
 // URL canónica absoluta de una página de idioma. El español es el x-default:
@@ -45,10 +50,10 @@ function fixAssets(html) {
 }
 
 // Sustituye el bloque canonical/hreflang por el de la URL limpia del idioma.
-function fixHead(html, lang, slug, esSlug) {
+function fixHead(html, lang, slug, esSlug, pageLangs = LANGS) {
   const canonical = `<link rel="canonical" href="${urlFor(lang, slug, esSlug)}" />`
   const alternates = [
-    ...LANGS.map(
+    ...pageLangs.map(
       (l) => `<link rel="alternate" hreflang="${l}" href="${urlFor(l, slug, esSlug)}" />`,
     ),
     `<link rel="alternate" hreflang="x-default" href="${BASE}/${esSlug}" />`,
@@ -86,13 +91,22 @@ function fixLinks(html, lang) {
     .replace(new RegExp(`href="/${lang}/features"`, 'g'), `href="/${lang}/features/"`)
     .replace(new RegExp(`href="/${lang}/integrations"`, 'g'), `href="/${lang}/integrations/"`)
     .replace(new RegExp(`href="/${lang}/home-assistant"`, 'g'), `href="/${lang}/home-assistant/"`)
+    // Changelog: solo hay página en los idiomas de la app; el resto enlaza al
+    // inglés, que es el idioma en que se escriben las notas.
+    .replace(/href="\/changelog/g, `href="/${CHANGELOG_LANGS.includes(lang) ? lang : 'en'}/changelog`)
 }
 
 async function main() {
-  const browser = await chromium.launch()
+  // CHROMIUM_PATH permite usar el navegador ya instalado en la máquina cuando
+  // la caché de Playwright no tiene la build que espera esta versión.
+  let written = 0
+  const browser = await chromium.launch(
+    process.env.CHROMIUM_PATH ? { executablePath: process.env.CHROMIUM_PATH } : {},
+  )
   const errors = []
   for (const lang of LANGS) {
     for (const page of PAGES) {
+      if (page.langs && !page.langs.includes(lang)) continue
       const ctx = await browser.newContext()
       const pg = await ctx.newPage()
       pg.on('pageerror', (e) => errors.push(`${lang}/${page.file}: ${e}`))
@@ -111,7 +125,7 @@ async function main() {
       if (!html.includes(`lang="${lang}"`)) {
         throw new Error(`lang attr no aplicado en ${lang}/${page.file}`)
       }
-      html = fixHead(html, lang, page.slug, page.esSlug)
+      html = fixHead(html, lang, page.slug, page.esSlug, page.langs)
       html = fixLinks(html, lang)
       html = html.replace(`/${lang}/features#`, `/${lang}/features/#`)
       html = fixAssets(html)
@@ -121,6 +135,7 @@ async function main() {
       const outDir = path.join(OUT, lang, page.outDir)
       await mkdir(outDir, { recursive: true })
       await writeFile(path.join(outDir, 'index.html'), html)
+      written++
       process.stdout.write(`${lang}/${page.file} `)
     }
     process.stdout.write('\n')
@@ -131,7 +146,7 @@ async function main() {
     errors.forEach((e) => console.error(' -', e))
     process.exit(1)
   }
-  console.log(`OK: ${LANGS.length * PAGES.length} páginas en ${OUT}`)
+  console.log(`OK: ${written} páginas en ${OUT} (${LANGS.length} idiomas)`)
 }
 
 main().catch((e) => {

Разница между файлами не показана из-за своего большого размера
+ 178 - 0
web/changelog.html


+ 114 - 0
web/changelog.template.html

@@ -0,0 +1,114 @@
+<!DOCTYPE html>
+<html lang="es">
+<head>
+  <meta charset="UTF-8" />
+  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+  <title data-i18n="changelogPage.metaTitle">NetPulse - Changelog</title>
+  <meta name="description" content="Todas las releases de NetPulse, con lo que cambió y por qué, desde la primera versión." data-i18n-attr="content" data-i18n="changelogPage.metaDescription" />
+  <meta name="theme-color" content="#070B12" />
+  <link rel="canonical" href="https://netpulse.cloudless.club/changelog" />
+  <link rel="alternate" hreflang="es" href="https://netpulse.cloudless.club/changelog" />
+  <link rel="alternate" hreflang="en" href="https://netpulse.cloudless.club/en/changelog/" />
+  <link rel="alternate" hreflang="zh" href="https://netpulse.cloudless.club/zh/changelog/" />
+  <link rel="alternate" hreflang="ru" href="https://netpulse.cloudless.club/ru/changelog/" />
+  <link rel="alternate" hreflang="x-default" href="https://netpulse.cloudless.club/changelog" />
+  <meta property="og:type" content="website" />
+  <meta property="og:site_name" content="NetPulse" />
+  <meta property="og:title" content="NetPulse - Changelog" data-i18n-attr="content" data-i18n="changelogPage.metaTitle" />
+  <meta property="og:description" content="Todas las releases de NetPulse, con lo que cambió y por qué." data-i18n-attr="content" data-i18n="changelogPage.metaDescription" />
+  <meta property="og:url" content="https://netpulse.cloudless.club/changelog" />
+  <meta property="og:image" content="https://netpulse.cloudless.club/og.png" />
+  <meta property="og:image:width" content="1200" />
+  <meta property="og:image:height" content="630" />
+  <meta property="og:locale" content="es_ES" />
+  <meta property="og:locale:alternate" content="en_US" />
+  <meta name="twitter:card" content="summary_large_image" />
+  <meta name="twitter:title" content="NetPulse - Changelog" data-i18n-attr="content" data-i18n="changelogPage.metaTitle" />
+  <meta name="twitter:description" content="Todas las releases de NetPulse, con lo que cambió y por qué." data-i18n-attr="content" data-i18n="changelogPage.metaDescription" />
+  <meta name="twitter:image" content="https://netpulse.cloudless.club/og.png" />
+  <link rel="icon" type="image/svg+xml" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 96 96' fill='none'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='10' y1='78' x2='90' y2='20' gradientUnits='userSpaceOnUse'%3E%3Cstop offset='0' stop-color='%2322D3EE'/%3E%3Cstop offset='1' stop-color='%23A78BFA'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M10 60 H27 L33 60 L40 38 L48 78 L54 48 L58 60 H64' stroke='url(%23g)' stroke-width='5.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3Ccircle cx='73' cy='60' r='6' fill='url(%23g)'/%3E%3Cpath d='M62.4 49.4 A15 15 0 0 1 83.6 49.4' stroke='url(%23g)' stroke-width='5' stroke-linecap='round'/%3E%3Cpath d='M55.3 39.7 A25 25 0 0 1 90.7 39.7' stroke='url(%23g)' stroke-width='5' stroke-linecap='round' opacity='0.6'/%3E%3C/svg%3E" />
+  <link rel="stylesheet" href="fonts/fonts.css" />
+  <link rel="stylesheet" href="styles.css?v=20261029b" />
+  <script src="i18n.js" defer></script>
+  <script src="app.js" defer></script>
+</head>
+<body>
+  <a class="skip" href="#main">Saltar al contenido</a>
+
+  <nav class="nav">
+    <div class="container nav-inner">
+      <a class="nav-logo" href="/">
+        <svg viewBox="0 0 96 96" fill="none" width="26" height="26" aria-hidden="true">
+          <path d="M10 60 H27 L33 60 L40 38 L48 78 L54 48 L58 60 H64" stroke="url(#np-g)" stroke-width="5.5" stroke-linecap="round" stroke-linejoin="round"/>
+          <circle cx="73" cy="60" r="6" fill="url(#np-g)"/>
+        </svg>
+        NetPulse
+      </a>
+      <div class="nav-links" id="navLinks">
+        <a href="/features" data-i18n="nav.features">Funciones</a>
+        <a href="/changelog" aria-current="page" data-i18n="nav.changelog">Changelog</a>
+        <a href="https://github.com/gnacho/netpulse" target="_blank" rel="noopener" data-i18n="nav.github">GitHub</a>
+      </div>
+      <select id="langSelect" aria-label="Language" style="margin-left:1rem;background:rgb(var(--surface));color:rgb(var(--text-secondary));border:1px solid rgb(var(--border));border-radius:var(--radius);padding:0.3rem 0.5rem;font-size:0.75rem;font-family:inherit;"></select>
+      <a class="nav-cta" href="/#install" data-i18n="nav.install">Instalar</a>
+      <button class="nav-burger" id="navBurger" type="button" aria-expanded="false" aria-controls="navLinks" data-i18n-aria="nav.menu" aria-label="Navigation menu">
+        <svg class="icon-open" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><path d="M4 7h16M4 12h16M4 17h16"/></svg>
+        <svg class="icon-close" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><path d="M6 6l12 12M18 6L6 18"/></svg>
+      </button>
+    </div>
+  </nav>
+
+  <header class="hero mesh-bg" style="min-height:42vh;padding:7rem 0 3rem;">
+    <div class="hero-halo" aria-hidden="true"></div>
+    <div class="container">
+      <span class="eyebrow" data-i18n="changelogPage.eyebrow">Changelog</span>
+      <h1 class="font-display text-balance" data-i18n="changelogPage.title">Todas las releases, en un sitio</h1>
+      <p class="hero-sub" data-i18n="changelogPage.sub">Qué cambió y por qué, release a release, desde la primera versión hasta la que estás usando.</p>
+    </div>
+  </header>
+
+  <main id="main" class="block" style="padding-top:1rem;">
+    <div class="container">
+      <p class="caption text-muted" data-i18n="changelogPage.note" style="margin-bottom:1.5rem;">Las notas de release están escritas en inglés. La página está traducida.</p>
+      <div class="changelog">
+        <!--RELEASES-->
+      </div>
+      <p class="caption text-muted" style="margin-top:1.5rem;">
+        <a href="https://github.com/gnacho/netpulse/releases" target="_blank" rel="noopener" data-i18n="changelogPage.github">Todos los binarios, en GitHub Releases</a>
+      </p>
+    </div>
+  </main>
+
+  <footer>
+    <div class="container">
+      <div class="foot-grid">
+        <div class="foot-col" style="max-width:22rem;">
+          <a class="nav-logo" href="/" style="margin-bottom:0.75rem;">
+            <svg viewBox="0 0 96 96" fill="none" width="22" height="22" aria-hidden="true">
+              <path d="M10 60 H27 L33 60 L40 38 L48 78 L54 48 L58 60 H64" stroke="url(#np-g)" stroke-width="5.5" stroke-linecap="round" stroke-linejoin="round"/>
+              <circle cx="73" cy="60" r="6" fill="url(#np-g)"/>
+            </svg>
+            NetPulse
+          </a>
+          <p class="caption text-muted" data-i18n="footer.tagline">Monitorización en vivo para redes domésticas, autoalojada y libre para siempre.</p>
+        </div>
+        <div class="foot-col">
+          <h4 data-i18n="footer.project">Proyecto</h4>
+          <a href="/features" data-i18n="nav.features">Funciones</a>
+          <a href="/changelog" data-i18n="nav.changelog">Changelog</a>
+          <a href="https://github.com/gnacho/netpulse/releases" target="_blank" rel="noopener" data-i18n="footer.releases">Releases</a>
+          <a href="https://github.com/gnacho/netpulse/blob/main/LICENSE" target="_blank" rel="noopener" data-i18n="footer.license">Licencia</a>
+        </div>
+        <div class="foot-col">
+          <h4 data-i18n="footer.community">Comunidad</h4>
+          <a href="https://github.com/gnacho/netpulse/issues" target="_blank" rel="noopener" data-i18n="footer.issues">Issues</a>
+          <a href="https://github.com/gnacho/netpulse/discussions" target="_blank" rel="noopener" data-i18n="footer.discussions">Discusiones</a>
+        </div>
+      </div>
+      <div class="foot-bottom">
+        <span data-i18n="footer.licenseLine">AGPL-3.0 · Hecho para redes domésticas</span>
+      </div>
+    </div>
+  </footer>
+</body>
+</html>

+ 1 - 0
web/features.html

@@ -643,6 +643,7 @@
         <div class="foot-col">
           <h4 data-i18n="footer.project">Proyecto</h4>
           <a href="/features" data-i18n="nav.features">Funciones</a>
+        <a href="/changelog" data-i18n="nav.changelog">Changelog</a>
           <a href="/home-assistant" data-i18n="haPage.navActive">Home Assistant</a>
           <a href="/integrations" data-i18n="integrationsPage.navActive">Integraciones</a>
           <a href="https://github.com/gnacho/netpulse/releases" target="_blank" rel="noopener" data-i18n="footer.releases">Releases</a>

+ 1 - 0
web/home-assistant.html

@@ -287,6 +287,7 @@ NETPULSE_MQTT_INSTANCE=casa</code>
         <div class="foot-col">
           <h4 data-i18n="footer.project">Proyecto</h4>
           <a href="/features" data-i18n="nav.features">Funciones</a>
+        <a href="/changelog" data-i18n="nav.changelog">Changelog</a>
           <a href="/home-assistant" data-i18n="haPage.navActive">Home Assistant</a>
           <a href="/integrations" data-i18n="integrationsPage.navActive">Integraciones</a>
           <a href="https://github.com/gnacho/netpulse/releases" target="_blank" rel="noopener" data-i18n="footer.releases">Releases</a>

+ 60 - 0
web/i18n.js

@@ -2226,6 +2226,59 @@ Object.entries(I18N_EXTRA).forEach(([lang, dict]) => {
         target[section] = Object.assign(target[section] || {}, keys);
     });
 });
+/* Changelog de la landing (#2148). La página se prerenderiza en los idiomas de
+   la app (es, en, zh, ru); el resto de idiomas del sitio cae a inglés para el
+   contenido y mantiene traducida la navegación. */
+const CHANGELOG_I18N = {
+    es: { nav: 'Changelog', page: {
+            metaTitle: 'NetPulse - Changelog',
+            metaDescription: 'Todas las releases de NetPulse, con lo que cambió y por qué, desde la primera versión.',
+            eyebrow: 'Changelog',
+            title: 'Todas las releases, en un sitio',
+            sub: 'Qué cambió y por qué, release a release, desde la primera versión hasta la que estás usando.',
+            note: 'Las notas de release están escritas en inglés. La página está traducida.',
+            github: 'Todos los binarios, en GitHub Releases',
+        } },
+    en: { nav: 'Changelog', page: {
+            metaTitle: 'NetPulse - Changelog',
+            metaDescription: 'Every NetPulse release, with what changed and why, from the first version.',
+            eyebrow: 'Changelog',
+            title: 'Every release, in one place',
+            sub: 'What changed and why, release by release, from the first version to the one you are running.',
+            note: 'Release notes are written in English, and this page follows the language of the app.',
+            github: 'Every binary, on GitHub Releases',
+        } },
+    zh: { nav: '更新日志', page: {
+            metaTitle: 'NetPulse - 更新日志',
+            metaDescription: 'NetPulse 的每个版本,以及改了什么、为什么改。',
+            eyebrow: '更新日志',
+            title: '所有版本,集中在一处',
+            sub: '每个版本改了什么、为什么改,从第一版到你正在使用的这一版。',
+            note: '更新说明以英文撰写,页面已翻译。',
+            github: '全部安装包见 GitHub Releases',
+        } },
+    ru: { nav: 'Журнал', page: {
+            metaTitle: 'NetPulse - Журнал изменений',
+            metaDescription: 'Все выпуски NetPulse: что изменилось и почему.',
+            eyebrow: 'Журнал',
+            title: 'Все выпуски в одном месте',
+            sub: 'Что изменилось и почему, выпуск за выпуском, от первой версии до той, что у вас.',
+            note: 'Заметки о выпусках написаны на английском, страница переведена.',
+            github: 'Все сборки на GitHub Releases',
+        } },
+    ar: { nav: 'سجل التغييرات' },
+    hi: { nav: 'चेंजलॉग' },
+    pt: { nav: 'Changelog' },
+    fr: { nav: 'Journal des versions' },
+    ja: { nav: '変更履歴' },
+    de: { nav: 'Changelog' },
+};
+Object.entries(CHANGELOG_I18N).forEach(([lang, dict]) => {
+    const target = I18N[lang] || (I18N[lang] = {});
+    target.nav = Object.assign(target.nav || {}, { changelog: dict.nav });
+    if (dict.page)
+        target.changelogPage = Object.assign(target.changelogPage || {}, dict.page);
+});
 /* Completar los idiomas que solo tenian traducida una parte (zh, ar, hi, pt,
    fr, ja, ru, de): claves que antes caian a ingles. Ver gnacho/netpulse#839. */
 const I18N_FILL = {
@@ -5359,6 +5412,13 @@ function buildLangSelect() {
     const prerenderSlug = document.documentElement.dataset.prerenderSlug;
     sel.addEventListener('change', () => {
         if (prerenderSlug !== undefined) {
+            // El changelog solo existe en los idiomas de la app: en el resto, la
+            // selección lleva a la home de ese idioma en vez de a un 404.
+            const only = document.documentElement.dataset.changelogLangs;
+            if (only && prerenderSlug.startsWith('changelog') && !only.split(',').includes(sel.value)) {
+                location.assign(`/${sel.value}/`);
+                return;
+            }
             location.assign(`/${sel.value}/${prerenderSlug}`);
             return;
         }

+ 1 - 0
web/index.html

@@ -110,6 +110,7 @@
       </a>
       <div class="nav-links" id="navLinks">
         <a href="/features" data-i18n="nav.features">Funciones</a>
+        <a href="/changelog" data-i18n="nav.changelog">Changelog</a>
         <a href="/home-assistant" data-i18n="haPage.navActive">Home Assistant</a>
         <a href="/integrations" data-i18n="integrationsPage.navActive">Integraciones</a>
         <a href="#how" data-i18n="nav.how">Cómo funciona</a>

+ 1 - 0
web/integrations.html

@@ -359,6 +359,7 @@ go build -o netpulse-integrations ./cmd/integrations-supervisor</code>
         <div class="foot-col">
           <h4 data-i18n="footer.project">Proyecto</h4>
           <a href="/features" data-i18n="nav.features">Funciones</a>
+        <a href="/changelog" data-i18n="nav.changelog">Changelog</a>
           <a href="/home-assistant" data-i18n="haPage.navActive">Home Assistant</a>
           <a href="/integrations" data-i18n="integrationsPage.navActive">Integraciones</a>
           <a href="https://github.com/gnacho/netpulse/releases" target="_blank" rel="noopener" data-i18n="footer.releases">Releases</a>

+ 4 - 0
web/sitemap.xml

@@ -240,4 +240,8 @@
     <changefreq>monthly</changefreq>
     <priority>0.7</priority>
   </url>
+  <url><loc>https://netpulse.cloudless.club/changelog</loc><changefreq>weekly</changefreq><priority>0.6</priority></url>
+  <url><loc>https://netpulse.cloudless.club/en/changelog/</loc><changefreq>weekly</changefreq><priority>0.6</priority></url>
+  <url><loc>https://netpulse.cloudless.club/zh/changelog/</loc><changefreq>weekly</changefreq><priority>0.6</priority></url>
+  <url><loc>https://netpulse.cloudless.club/ru/changelog/</loc><changefreq>weekly</changefreq><priority>0.6</priority></url>
 </urlset>

+ 3 - 0
web/src/app.ts

@@ -1291,6 +1291,9 @@ function initAppearance() {
   applyTheme(); updateAppearancePanel()
   const fab = document.getElementById('appFab')
   const panel = document.getElementById('appPanel')
+  // Páginas sin el panel de apariencia (el changelog, #2148) no lo tienen: el
+  // tema guardado se sigue aplicando arriba, solo se salta el control.
+  if (!fab || !panel) return
   fab.addEventListener('click', () => { panel.classList.toggle('open'); fab.setAttribute('aria-expanded', String(panel.classList.contains('open'))) })
   document.addEventListener('click', e => { if (!panel.contains(e.target as Node) && !fab.contains(e.target as Node)) panel.classList.remove('open') })
   document.addEventListener('keydown', e => { if (e.key === 'Escape') panel.classList.remove('open') })

+ 60 - 0
web/src/i18n.ts

@@ -2238,6 +2238,59 @@ Object.entries(I18N_EXTRA).forEach(([lang, dict]) => {
   })
 })
 
+/* Changelog de la landing (#2148). La página se prerenderiza en los idiomas de
+   la app (es, en, zh, ru); el resto de idiomas del sitio cae a inglés para el
+   contenido y mantiene traducida la navegación. */
+const CHANGELOG_I18N: Record<string, { nav: string; page?: Record<string, string> }> = {
+  es: { nav: 'Changelog', page: {
+    metaTitle: 'NetPulse - Changelog',
+    metaDescription: 'Todas las releases de NetPulse, con lo que cambió y por qué, desde la primera versión.',
+    eyebrow: 'Changelog',
+    title: 'Todas las releases, en un sitio',
+    sub: 'Qué cambió y por qué, release a release, desde la primera versión hasta la que estás usando.',
+    note: 'Las notas de release están escritas en inglés. La página está traducida.',
+    github: 'Todos los binarios, en GitHub Releases',
+  } },
+  en: { nav: 'Changelog', page: {
+    metaTitle: 'NetPulse - Changelog',
+    metaDescription: 'Every NetPulse release, with what changed and why, from the first version.',
+    eyebrow: 'Changelog',
+    title: 'Every release, in one place',
+    sub: 'What changed and why, release by release, from the first version to the one you are running.',
+    note: 'Release notes are written in English, and this page follows the language of the app.',
+    github: 'Every binary, on GitHub Releases',
+  } },
+  zh: { nav: '更新日志', page: {
+    metaTitle: 'NetPulse - 更新日志',
+    metaDescription: 'NetPulse 的每个版本,以及改了什么、为什么改。',
+    eyebrow: '更新日志',
+    title: '所有版本,集中在一处',
+    sub: '每个版本改了什么、为什么改,从第一版到你正在使用的这一版。',
+    note: '更新说明以英文撰写,页面已翻译。',
+    github: '全部安装包见 GitHub Releases',
+  } },
+  ru: { nav: 'Журнал', page: {
+    metaTitle: 'NetPulse - Журнал изменений',
+    metaDescription: 'Все выпуски NetPulse: что изменилось и почему.',
+    eyebrow: 'Журнал',
+    title: 'Все выпуски в одном месте',
+    sub: 'Что изменилось и почему, выпуск за выпуском, от первой версии до той, что у вас.',
+    note: 'Заметки о выпусках написаны на английском, страница переведена.',
+    github: 'Все сборки на GitHub Releases',
+  } },
+  ar: { nav: 'سجل التغييرات' },
+  hi: { nav: 'चेंजलॉग' },
+  pt: { nav: 'Changelog' },
+  fr: { nav: 'Journal des versions' },
+  ja: { nav: '変更履歴' },
+  de: { nav: 'Changelog' },
+}
+Object.entries(CHANGELOG_I18N).forEach(([lang, dict]) => {
+  const target = I18N[lang] || (I18N[lang] = {})
+  target.nav = Object.assign(target.nav || {}, { changelog: dict.nav })
+  if (dict.page) target.changelogPage = Object.assign(target.changelogPage || {}, dict.page)
+})
+
 /* Completar los idiomas que solo tenian traducida una parte (zh, ar, hi, pt,
    fr, ja, ru, de): claves que antes caian a ingles. Ver gnacho/netpulse#839. */
 const I18N_FILL = {
@@ -5358,6 +5411,13 @@ function buildLangSelect() {
   const prerenderSlug = document.documentElement.dataset.prerenderSlug
   sel.addEventListener('change', () => {
     if (prerenderSlug !== undefined) {
+      // El changelog solo existe en los idiomas de la app: en el resto, la
+      // selección lleva a la home de ese idioma en vez de a un 404.
+      const only = document.documentElement.dataset.changelogLangs
+      if (only && prerenderSlug.startsWith('changelog') && !only.split(',').includes(sel.value)) {
+        location.assign(`/${sel.value}/`)
+        return
+      }
       location.assign(`/${sel.value}/${prerenderSlug}`)
       return
     }

+ 17 - 0
web/styles.css

@@ -770,3 +770,20 @@ html[dir="rtl"] .honest { border-left: none; border-right: 3px solid rgb(var(--w
 .honest-list li::before { content: "x"; position: absolute; left: 0; top: 0.05rem; color: rgb(var(--warn)); font-weight: 700; font-size: 1rem; }
 html[dir="rtl"] .honest-list li { padding-left: 0; padding-right: 1.25rem; }
 html[dir="rtl"] .honest-list li::before { left: auto; right: 0; }
+
+/* Changelog (#2148): una entrada por release, plegable. */
+.changelog { display: flex; flex-direction: column; gap: 0.75rem; }
+.changelog-entry { border: 1px solid rgb(var(--border)); border-radius: var(--radius-lg, 12px); background: rgb(var(--surface)); padding: 0.25rem 1rem; }
+.changelog-entry > summary { cursor: pointer; display: flex; align-items: center; justify-content: space-between; padding: 0.85rem 0; list-style: none; }
+.changelog-entry > summary::-webkit-details-marker { display: none; }
+.changelog-tag { font-family: var(--font-mono, ui-monospace, monospace); font-weight: 600; color: rgb(var(--accent)); }
+.changelog-arrow { color: rgb(var(--text-muted)); transition: transform 0.15s ease; }
+.changelog-entry[open] .changelog-arrow { transform: rotate(180deg); }
+.changelog-body { padding: 0.25rem 0 1rem; border-top: 1px solid rgb(var(--border)); color: rgb(var(--text-secondary)); }
+.changelog-body h3, .changelog-body h4, .changelog-body h5 { color: rgb(var(--text-primary)); margin: 1.2rem 0 0.5rem; }
+.changelog-body ul, .changelog-body ol { margin: 0.5rem 0 0.9rem 1.2rem; }
+.changelog-body li { margin: 0.35rem 0; line-height: 1.55; }
+.changelog-body p { margin: 0.6rem 0; line-height: 1.6; }
+.changelog-body code { font-family: var(--font-mono, ui-monospace, monospace); font-size: 0.9em; background: rgb(var(--surface-2, var(--surface))); padding: 0.1rem 0.3rem; border-radius: 4px; }
+.changelog-body pre { background: rgb(var(--surface-2, var(--surface))); padding: 0.75rem; border-radius: 8px; overflow-x: auto; }
+.changelog-body a { color: rgb(var(--accent)); text-decoration: underline; }

Некоторые файлы не были показаны из-за большого количества измененных файлов