Public /network page (alias /how-it-works): the one-page 'How the Crypto Team Build Network Works' explainer, shareable (Marty 2026-11-17); in the sitemap
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -163,7 +163,7 @@ async function qrSvg(un) {
|
||||
function notFound(msg) { return head({ title: 'Not found | Stack POL', desc: 'This page is not on Stack POL.', path: '/404', noindex: true }) + '<section style="padding:60px 0"><h1>Nothing stacked here</h1><p class="lead">' + esc(msg || 'That page does not exist.') + '</p><p><a class="btn" href="/">Go to Stack POL</a></p></section>' + tail(); }
|
||||
function sitemap() {
|
||||
const d = new Date().toISOString().slice(0, 10);
|
||||
const u = [['/', 'daily', '1.0'], ['/programs', 'daily', '0.9'], ['/ledger', 'hourly', '0.8'], ['/blog', 'daily', '0.9'], ['/terms', 'yearly', '0.2'], ['/privacy', 'yearly', '0.2'], ['/disclaimer', 'yearly', '0.2']].map(([p, f, pr]) => '<url><loc>' + SITE + p + '</loc><lastmod>' + d + '</lastmod><changefreq>' + f + '</changefreq><priority>' + pr + '</priority></url>').join('')
|
||||
const u = [['/', 'daily', '1.0'], ['/programs', 'daily', '0.9'], ['/network', 'monthly', '0.7'], ['/ledger', 'hourly', '0.8'], ['/blog', 'daily', '0.9'], ['/terms', 'yearly', '0.2'], ['/privacy', 'yearly', '0.2'], ['/disclaimer', 'yearly', '0.2']].map(([p, f, pr]) => '<url><loc>' + SITE + p + '</loc><lastmod>' + d + '</lastmod><changefreq>' + f + '</changefreq><priority>' + pr + '</priority></url>').join('')
|
||||
+ PROGRAMS.map(p => '<url><loc>' + SITE + '/earn/' + p.slug + '</loc><lastmod>' + d + '</lastmod><changefreq>daily</changefreq><priority>0.8</priority></url>').join('')
|
||||
+ blog.listPublished().map(p => '<url><loc>' + SITE + '/blog/' + p.slug + '</loc><lastmod>' + new Date(p.updated).toISOString().slice(0, 10) + '</lastmod><changefreq>monthly</changefreq><priority>0.7</priority></url>').join('')
|
||||
+ Object.keys((IDX && IDX.stacks) || {}).map(x => '<url><loc>' + SITE + '/' + x + '</loc><changefreq>daily</changefreq><priority>0.5</priority></url>').join('');
|
||||
@@ -171,7 +171,7 @@ function sitemap() {
|
||||
}
|
||||
const robots = () => 'User-agent: *\nAllow: /\nDisallow: /api/\n\nSitemap: ' + SITE + '/sitemap.xml\n';
|
||||
|
||||
const TYPES = { '.js': 'text/javascript; charset=utf-8', '.css': 'text/css; charset=utf-8', '.jpg': 'image/jpeg', '.png': 'image/png', '.svg': 'image/svg+xml', '.mp4': 'video/mp4', '.webmanifest': 'application/manifest+json', '.ico': 'image/x-icon', '.txt': 'text/plain; charset=utf-8', '.xml': 'application/xml' };
|
||||
const TYPES = { '.html': 'text/html; charset=utf-8', '.js': 'text/javascript; charset=utf-8', '.css': 'text/css; charset=utf-8', '.jpg': 'image/jpeg', '.png': 'image/png', '.svg': 'image/svg+xml', '.mp4': 'video/mp4', '.webmanifest': 'application/manifest+json', '.ico': 'image/x-icon', '.txt': 'text/plain; charset=utf-8', '.xml': 'application/xml' };
|
||||
function send(req, res, code, type, body, cache) {
|
||||
const h = { 'Content-Type': type, 'Cache-Control': cache || 'public, max-age=60', 'X-Content-Type-Options': 'nosniff', 'Referrer-Policy': 'strict-origin-when-cross-origin' };
|
||||
if (/gzip/.test(req.headers['accept-encoding'] || '') && /text|xml|json|javascript/.test(type) && body.length > 1024) { h['Content-Encoding'] = 'gzip'; h.Vary = 'Accept-Encoding'; body = zlib.gzipSync(body); }
|
||||
@@ -224,6 +224,7 @@ const server = http.createServer((req, res) => {
|
||||
if (q) { const st = IDX && IDX.stacks && IDX.stacks[q[1]]; if (!QR || !st || !st.pro) return html(req, res, 404, notFound()); return qrSvg(q[1]).then(svg => send(req, res, 200, 'image/svg+xml', svg, 'public, max-age=86400')).catch(() => html(req, res, 500, notFound())); }
|
||||
if (p === '/') return html(req, res, 200, page(home()), 'public, max-age=120');
|
||||
if (legal.PATHS.includes(p)) return html(req, res, 200, page(legal.render(p)), 'public, max-age=3600'); // Terms / Privacy / Disclaimer (2026-11-17)
|
||||
if (p === '/network' || p === '/how-it-works') return staticFile(req, res, '/network.html') || html(req, res, 404, notFound()); // the one-page network explainer (Marty 2026-11-17)
|
||||
if (p === '/programs') return html(req, res, 200, page(programsPage()), 'public, max-age=300');
|
||||
if (p === '/ledger') return html(req, res, 200, page(ledgerPage(u.searchParams.get('p'))), 'public, max-age=120');
|
||||
let m = /^\/earn\/([a-z0-9-]+)\/?$/.exec(p); if (m) return BY_SLUG[m[1]] ? html(req, res, 200, page(programPage(BY_SLUG[m[1]], pc && pc.who)), 'public, max-age=300') : html(req, res, 404, notFound());
|
||||
|
||||
Reference in New Issue
Block a user