LordOS — a free, fast and secure GNU/Linux distribution based on Debian, with its own desktop environment: display server and Wayland compositor in C, a React UI engine on QuickJS, and private native apps.
C cdebiandesktop-environmentebpffirewalllandlocklinuxlinux-distributionopen-sourceprivacyquickjsraspberry-pi-5reactsecuritywaylandwayland-compositor
Website: legal index page, sidebar grouped into Legal and Trust & security, redirect page for /legal/cookies/
Federico Pereira5b87270ff2cf
diff --git a/web/build.mjs b/web/build.mjsindex 5e0656d..3f03e36 100644--- a/web/build.mjs+++ b/web/build.mjs@@ -203,8 +203,22 @@ const legalIndex = fs.existsSync(path.join(legalDir, 'pages.json')) ? readJson(pconst hasPh = (text) => /\[\[[A-Z][A-Z0-9_]*\]\]/.test(text);// production: legal pages that still contain [[PLACEHOLDERS]] are left out (--allow-placeholders keeps them, highlighted)const legalAll = legalIndex ? (legalIndex.pages || []).filter((p) => LANGS.every((l) => fs.existsSync(path.join(legalDir, `${p.slug}.${l}.md`)))) : [];-const legalPages = legalAll.filter((p) => ALLOW_PH || !LANGS.some((l) => hasPh(fs.readFileSync(path.join(legalDir, `${p.slug}.${l}.md`), 'utf8')) || hasPh(JSON.stringify(p))));-const legalHeld = legalAll.filter((p) => !legalPages.includes(p)).map((p) => p.slug);+const LEGAL_MOVED = [['cookies', 'cookies-and-statistics']];+const legalPages = legalAll.filter((p) => !LEGAL_MOVED.some(([from, to]) => p.slug === from && legalAll.some((x) => x.slug === to))).filter((p) => ALLOW_PH || !LANGS.some((l) => hasPh(fs.readFileSync(path.join(legalDir, `${p.slug}.${l}.md`), 'utf8')) || hasPh(JSON.stringify(p))));+const legalHeld = legalAll.filter((p) => !legalPages.includes(p) && !LEGAL_MOVED.some(([from]) => from === p.slug)).map((p) => p.slug);+const LEGAL_GROUPS = ['legal', 'trust'];+const TRUST = new Set(['security', 'code-signing', 'issues', 'support-lifecycle', 'standards', 'code-of-conduct', 'contributing', 'accessibility']);+const legalGroup = (p) => (p.group === 'trust' || p.group === 'legal' ? p.group : TRUST.has(p.slug) ? 'trust' : 'legal');+// one-line description for the /legal/ index: pages.json "description", else the first sentence of the page+function legalDesc(p, l) {+ const d = loc(p.description, l);+ if (d) return d;+ const md = fs.readFileSync(path.join(legalDir, `${p.slug}.${l}.md`), 'utf8').replace(/^---[\s\S]*?---\n/, '');+ const para = md.split(/\n\s*\n/).map((x) => x.trim()).find((x) => x && !x.startsWith('#') && !x.startsWith('|') && !x.startsWith('-')) || '';+ const plain = para.replace(/\[([^\]]+)\]\([^)]*\)/g, '$1').replace(/[`*_]/g, '').replace(/\s+/g, ' ');+ const m = plain.match(/^(.{40,220}?[.!?])(\s|$)/);+ return m ? m[1] : plain.slice(0, 200);+}const faqFile = path.join(CONTENT, 'faq/faq.json');const faqJson = fs.existsSync(faqFile) ? readJson(faqFile) : null;let faqHeld = 0;@@ -332,7 +346,7 @@ function linkBuilt(href) {}let _built = null;function builtPages() {- if (!_built) _built = new Set(['', 'apps', 'gallery', 'about', ...featureList.map((m) => 'features/' + m.slug), ...(HAS_PAPER ? ['paper'] : []), ...(HAS_FAQ ? ['faq'] : []), ...legalPages.map((x) => 'legal/' + x.slug)]);+ if (!_built) _built = new Set(['', 'apps', 'gallery', 'about', ...featureList.map((m) => 'features/' + m.slug), ...(HAS_PAPER ? ['paper'] : []), ...(HAS_FAQ ? ['faq'] : []), ...legalPages.map((x) => 'legal/' + x.slug), ...(legalPages.length ? ['legal', ...LEGAL_MOVED.map((m) => 'legal/' + m[0])] : [])]);return _built;}function langLinks(t, page) {@@ -417,7 +431,7 @@ ${icons}</section>`;}-const tpl = { home: src('home.html'), gallery: src('gallery.html'), apps: src('apps.html'), notFound: src('404.html'), lightbox: src('lightbox.html'), feature: src('feature.html'), paper: src('paper.html'), legal: src('legal.html'), faq: src('faq.html'), about: src('about.html') };+const tpl = { home: src('home.html'), gallery: src('gallery.html'), apps: src('apps.html'), notFound: src('404.html'), lightbox: src('lightbox.html'), feature: src('feature.html'), paper: src('paper.html'), legal: src('legal.html'), legalIndex: src('legal-index.html'), faq: src('faq.html'), about: src('about.html') };for (const l of LANGS) {const t = dict[l];@@ -587,13 +601,46 @@ ${apps.filter((a) => a.category === c).sort((x, y) => appName(x, l).localeComparconst { html: bodyHtml } = renderMd(body, [], [], null, `legal/${lp.slug}.${l}.md`);const title = loc(lp.title, l) || lp.slug;const updated = lp.updated || legalIndex.updated || today;- const nav = legalPages.map((x) => `<li><a href="${pageUrl(l, 'legal/' + x.slug)}"${x.slug === lp.slug ? ' aria-current="page"' : ''}>${esc(loc(x.title, l) || x.slug)}</a></li>`).join('\n');+ const nav = LEGAL_GROUPS.map((g) => {+ const ps = legalPages.filter((x) => legalGroup(x) === g);+ return ps.length ? `<h2>${esc(t.pages.legal.groups[g])}</h2>\n<ul>\n${ps.map((x) => `<li><a href="${pageUrl(l, 'legal/' + x.slug)}"${x.slug === lp.slug ? ' aria-current="page"' : ''}>${esc(loc(x.title, l) || x.slug)}</a></li>`).join('\n')}\n</ul>` : '';+ }).join('\n');write(path.join(pageUrl(l, page), 'index.html'), render(tpl.legal, {...common(page, [`${title} · LordOS`, loc(lp.description, l) || `${title} — lordos.org`], true),- title: phOut(esc(phIn(title, 'legal/pages.json'))), updated: esc(fmtDate(updated)), updatedIso: esc(updated), nav, body: bodyHtml,+ title: phOut(esc(phIn(title, 'legal/pages.json'))), updated: esc(fmtDate(updated)), updatedIso: esc(updated), nav, body: bodyHtml, indexUrl: pageUrl(l, 'legal'),}, t));}+ // legal index and redirects for moved legal pages+ if (legalPages.length) {+ const groups = LEGAL_GROUPS.map((g) => {+ const ps = legalPages.filter((x) => legalGroup(x) === g);+ if (!ps.length) return '';+ return `<section aria-labelledby="lg-${g}"><h2 id="lg-${g}">${esc(t.pages.legal.groups[g])}</h2><ul class="lcards">${ps.map((x) => `<li><a href="${pageUrl(l, 'legal/' + x.slug)}"><strong>${esc(loc(x.title, l) || x.slug)}</strong><span>${esc(legalDesc(x, l))}</span></a></li>`).join('')}</ul></section>`;+ }).join('\n');+ write(path.join(pageUrl(l, 'legal'), 'index.html'), render(tpl.legalIndex, { ...common('legal', [`${t.pages.legal.indexTitle} · LordOS`, t.pages.legal.metaIndex], true), groups }, t));+ for (const [from, to] of LEGAL_MOVED) {+ if (legalPages.some((x) => x.slug === from) || !legalPages.some((x) => x.slug === to)) continue;+ const dest = SITE + pageUrl(l, 'legal/' + to);+ write(path.join(pageUrl(l, 'legal/' + from), 'index.html'), `<!doctype html>+<html lang="${l}">+<head>+<meta charset="utf-8">+<meta name="viewport" content="width=device-width, initial-scale=1">+<title>${esc(loc(legalPages.find((x) => x.slug === to).title, l))} · LordOS</title>+<meta name="robots" content="noindex">+<link rel="canonical" href="${dest}">+<meta http-equiv="refresh" content="0; url=${dest}">+<link rel="stylesheet" href="${cssUrl}">+</head>+<body>+<p class="moved">${esc(t.pages.legal.moved)} <a href="${dest}">${dest}</a></p>+</body>+</html>+`);+ }+ }+// FAQif (HAS_FAQ) {const cats = faqJson.categories;@@ -666,7 +713,7 @@ if (fs.existsSync(secTxt)) {else log('security.txt held back: it still has placeholders');}write('robots.txt', `User-agent: *\nAllow: /\n\nSitemap: ${SITE}/sitemap.xml\n`);-const allPages = [...PAGES.filter((p) => p !== 'apps' || HAS_APPS), ...featureList.map((m) => 'features/' + m.slug), ...(HAS_PAPER ? ['paper'] : []), ...(HAS_FAQ ? ['faq'] : []), 'about', ...legalPages.map((p) => 'legal/' + p.slug)];+const allPages = [...PAGES.filter((p) => p !== 'apps' || HAS_APPS), ...featureList.map((m) => 'features/' + m.slug), ...(HAS_PAPER ? ['paper'] : []), ...(HAS_FAQ ? ['faq'] : []), 'about', ...legalPages.map((p) => 'legal/' + p.slug), ...(legalPages.length ? ['legal'] : [])];const urls = allPages.flatMap((p) => LANGS.map((l) => ` <url><loc>${SITE}${pageUrl(l, p)}</loc><lastmod>${today}</lastmod>diff --git a/web/i18n/pages.json b/web/i18n/pages.jsonindex 007f07f..dd786e8 100644--- a/web/i18n/pages.json+++ b/web/i18n/pages.json@@ -33,7 +33,16 @@"lumoSays": "Lumo says","legal": {"nav": "Legal",- "updated": "Last updated"+ "updated": "Last updated",+ "indexTitle": "Legal and trust",+ "indexLead": "The terms, policies and notices for lordos.org and LordOS, and how we handle security and trust.",+ "groups": {+ "legal": "Legal",+ "trust": "Trust & security"+ },+ "all": "All legal pages",+ "moved": "This page has moved to",+ "metaIndex": "Terms, privacy, licenses, trademark, security and trust policies for LordOS and lordos.org."},"faq": {"title": "Frequently asked questions",@@ -131,7 +140,16 @@"lumoSays": "Lumo cuenta","legal": {"nav": "Legal",- "updated": "Última actualización"+ "updated": "Última actualización",+ "indexTitle": "Legal y confianza",+ "indexLead": "Los términos, políticas y avisos de lordos.org y LordOS, y cómo manejamos la seguridad y la confianza.",+ "groups": {+ "legal": "Legal",+ "trust": "Confianza y seguridad"+ },+ "all": "Todas las páginas legales",+ "moved": "Esta página se mudó a",+ "metaIndex": "Términos, privacidad, licencias, marca, seguridad y políticas de confianza de LordOS y lordos.org."},"faq": {"title": "Preguntas frecuentes",@@ -229,7 +247,16 @@"lumoSays": "Lumo conta","legal": {"nav": "Jurídico",- "updated": "Última atualização"+ "updated": "Última atualização",+ "indexTitle": "Jurídico e confiança",+ "indexLead": "Os termos, políticas e avisos do lordos.org e do LordOS, e como tratamos segurança e confiança.",+ "groups": {+ "legal": "Jurídico",+ "trust": "Confiança e segurança"+ },+ "all": "Todas as páginas jurídicas",+ "moved": "Esta página mudou para",+ "metaIndex": "Termos, privacidade, licenças, marca, segurança e políticas de confiança do LordOS e do lordos.org."},"faq": {"title": "Perguntas frequentes",diff --git a/web/src/doc.css b/web/src/doc.cssindex 9983fec..42dc862 100644--- a/web/src/doc.css+++ b/web/src/doc.css@@ -153,6 +153,17 @@mark.ph{background:#FFE58A;color:#3A2A00;padding:1px 6px;border-radius:6px;font-weight:700;outline:2px dashed #C26A00}@media (max-width:860px){.legal{grid-template-columns:minmax(0,1fr);gap:24px}.legal-nav{position:static;order:2;border-top:1px solid var(--line);padding-top:20px}}+.legal-nav .toc-t a{color:inherit;text-decoration:none}+.legal-nav .toc-t a:hover{color:var(--brand)}+.legal-nav h2{margin:18px 0 6px;font-size:12px;font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:var(--subtle)}+.legal-index h2{margin:44px 0 14px;font-size:clamp(22px,2.6vw,28px);font-weight:800}+.lcards{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:14px}+.lcards a{display:flex;flex-direction:column;gap:6px;height:100%;padding:18px 20px;border:1px solid var(--line-2);border-radius:16px;background:var(--surface);text-decoration:none;color:var(--ink)}+.lcards a:hover{border-color:var(--accent)}+.lcards strong{font-size:17px}+.lcards span{color:var(--muted);font-size:15px;line-height:1.5}+.moved{max-width:640px;margin:0 auto;padding:96px 24px;text-align:center;font-size:18px}+/* FAQ */.faq-tools{margin-top:28px;display:flex;flex-direction:column;gap:16px}.faq-search{display:none;align-items:center;gap:10px;max-width:560px;min-height:52px;padding:0 16px;border-radius:14px;background:var(--surface);box-shadow:inset 0 0 0 1.5px var(--chip-line);color:var(--subtle)}diff --git a/web/src/legal-index.html b/web/src/legal-index.htmlnew file mode 100644index 0000000..fc4d769--- /dev/null+++ b/web/src/legal-index.html@@ -0,0 +1,20 @@+<!doctype html>+<html lang="{{t.lang}}">+<head>+{{{head}}}+</head>+<body data-page="legal-index" data-lang="{{t.lang}}">+<a class="skip" href="#main">{{t.skip}}</a>+{{{header}}}++<main id="main" class="wrap g-main legal-index">+<p class="kicker">{{t.pages.legal.nav}}</p>+<h1>{{t.pages.legal.indexTitle}}</h1>+<p class="g-lead">{{t.pages.legal.indexLead}}</p>+{{{groups}}}+</main>++{{{footer}}}+<script src="{{{js}}}" defer></script>+</body>+</html>diff --git a/web/src/legal.html b/web/src/legal.htmlindex 6f20f21..e5785f8 100644--- a/web/src/legal.html+++ b/web/src/legal.html@@ -9,10 +9,8 @@<div class="wrap legal"><nav class="legal-nav" aria-label="{{t.pages.legal.nav}}">-<p class="toc-t">{{t.pages.legal.nav}}</p>-<ul>+<p class="toc-t"><a href="{{{indexUrl}}}">{{t.pages.legal.all}}</a></p>{{{nav}}}-</ul></nav><main id="main" class="legal-main"><h1>{{{title}}}</h1>