forked from unimatrix/web
Publish The Great Migration Alpha 1.0.0.6 and 1.0.0.7 release
This commit is contained in:
parent
e772698229
commit
04730a1323
1 changed files with 346 additions and 79 deletions
|
|
@ -3,8 +3,8 @@ const scripts=new URL('./',import.meta.url),web=new URL('../web/',import.meta.ur
|
|||
const esc=s=>String(s).replace(/[&<>"']/g,c=>({'&':'&','<':'<','>':'>','"':'"',"'":'''}[c]));
|
||||
const urgent=releases.filter(r=>r.kind==='bugfix').slice(0,3);const urgentCards=urgent.length?'<section class="urgent-bugfix-news" aria-label="Urgent development bugfixes"><h2>Urgent bugfix reports</h2><div>'+urgent.map(r=>'<article><img src="assets/bugfix-seal.svg" alt=""><p>BUGFIX · '+esc(r.version)+'</p><h3><a href="'+releaseFile(r.version)+'">'+esc(r.title)+'</a></h3><p>'+esc(r.synopsis)+'</p><a href="'+releaseFile(r.version)+'">Problem, repair & verification →</a></article>').join('')+'</div></section>':'';
|
||||
for(const file of readdirSync(web).filter(x=>x.endsWith('.html'))){let text=readFileSync(new URL(file,web),'utf8');text=text.replace(/<section class="urgent-bugfix-news"[\s\S]*?<\/section>/g,'');if(urgentCards&&['news.html','index.html'].includes(file))text=text.replace(/(<nav id="realm-menu"[\s\S]*?<\/nav>)/,'$1'+urgentCards);text=text.replace(/<footer>[\s\S]*?<\/footer>/,footer=>footer.includes('href="patch-notes.html"')?footer:footer.replace('<a href="staff.html">','<a href="patch-notes.html">Patch notes →</a><a href="staff.html">'));if(file==='news.html'&&!text.includes('class="development-news-link"'))text=text.replace(/(<nav id="realm-menu"[\s\S]*?<\/nav>)/,'$1<aside class="development-news-link"><a class="button gold" href="patch-notes.html">Website & plugin patch notes →</a><p>Game dispatches appear below. Development releases have their own register.</p></aside>');writeFileSync(new URL(file,web),text)}
|
||||
const base=readFileSync(new URL('index.html',web),'utf8'),header=base.match(/<header>[\s\S]*?<\/header>/)[0].replace(/ aria-current="page"/g,''),menu=base.match(/<nav id="realm-menu"[\s\S]*?<\/nav>/)[0],footer=base.match(/<footer>[\s\S]*?<\/footer>/)[0];
|
||||
function shell(title,body){return '<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>'+esc(title)+' — dunerealms.com</title><meta name="description" content="dunerealms.com development releases, urgent bugfix reports and pending feature bundles."><link rel="icon" href="assets/favicon.svg">'+['styles','pages','minecraft','lore','patchnotes'].map(x=>'<link rel="stylesheet" href="'+x+'.css">').join('')+'<script src="pages.js" defer></script><script src="patchnotes.js" defer></script></head><body><a class="skip" href="#patchnotes-content">Skip to content</a>'+header+'<main><section class="page-intro intro-patchnotes"><p class="eyebrow">dunerealms.com / GUILD CHANGE REGISTER</p><h1>'+esc(title)+'</h1><p>Traceable changes to the website and plugin. Completed work, published bundles and urgent repairs.</p></section>'+menu+'<div id="patchnotes-content" class="patchnotes-content">'+body+'</div></main>'+footer+'<div class="toast" role="status" aria-live="polite"></div></body></html>'}
|
||||
const base=readFileSync(new URL('index.html',web),'utf8'),header=base.match(/<header\b[^>]*>[\s\S]*?<\/header>/)[0].replace(/ aria-current="page"/g,''),menu=(base.match(/<nav id="realm-menu"[\s\S]*?<\/nav>/)?.[0]||'<nav aria-label="Release register"><a href="patch-notes.html">All releases</a> · <a href="news.html">News</a></nav>'),footer=base.match(/<footer>[\s\S]*?<\/footer>/)[0];
|
||||
function shell(title,body){return '<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>'+esc(title)+' — dunerealms.com</title><meta name="description" content="dunerealms.com development releases, urgent bugfix reports and pending feature bundles."><link rel="icon" href="assets/favicon.svg">'+['styles','pages','minecraft','lore','patchnotes'].map(x=>'<link rel="stylesheet" href="'+x+'.css">').join('')+'<link rel="stylesheet" href="portal-navigation.css"><script src="portal-navigation.js" defer></script><script src="pages.js" defer></script><script src="patchnotes.js" defer></script></head><body><a class="skip" href="#patchnotes-content">Skip to content</a>'+header+'<main><section class="page-intro intro-patchnotes"><p class="eyebrow">dunerealms.com / GUILD CHANGE REGISTER</p><h1>'+esc(title)+'</h1><p>Traceable changes to the website and plugin. Completed work, published bundles and urgent repairs.</p></section>'+menu+'<div id="patchnotes-content" class="patchnotes-content">'+body+'</div></main>'+footer+'<div class="toast" role="status" aria-live="polite"></div></body></html>'}
|
||||
const stats='<section class="patch-stats"><div><strong>'+releases.filter(x=>x.kind==='normal').length+'</strong><span>Published bundles</span></div><div><strong>'+releases.filter(x=>x.kind==='bugfix').length+'</strong><span>Urgent bugfix reports</span></div><div><strong>'+pending.completed.length+' / 5</strong><span>Completed tasks toward next bundle</span></div></section>';
|
||||
const cards=releases.map(r=>'<article class="patch-card kind-'+r.kind+'" data-kind="'+r.kind+'"><p class="patch-kind">'+(r.kind==='bugfix'?'URGENT BUGFIX':'BUNDLED PRODUCT UPDATE')+' · '+esc(r.version)+'</p><h3><a href="'+releaseFile(r.version)+'">'+esc(r.title)+'</a></h3><p>'+esc(r.synopsis)+'</p><small>'+esc(r.date)+' · '+r.tasks.length+' product '+(r.tasks.length===1?'task':'tasks')+'</small><a href="'+releaseFile(r.version)+'">Read full patch note →</a></article>').join('');
|
||||
const waiting=pending.completed.map(t=>'<article class="pending-task"><p class="patch-kind">'+t.promptIds.map(esc).join(' · ')+' / '+esc(t.priority)+'</p><h3>'+esc(t.title)+'</h3><ul>'+t.changes.map(c=>'<li>'+esc(c)+'</li>').join('')+'</ul><small>Completed '+esc(t.completedAt)+' · awaiting a normal bundle</small></article>').join('');
|
||||
|
|
|
|||
Loading…
Reference in a new issue

Staff