MC/website/scripts/build-staff.mjs
2026-11-27 23:43:05 +00:00

9 lines
5.2 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import {readFileSync,writeFileSync,readdirSync} from 'node:fs';
const web=new URL('../web/',import.meta.url),data=JSON.parse(readFileSync(new URL('staff-data.json',web),'utf8'));
const esc=s=>String(s).replace(/[&<>"']/g,c=>({'&':'&amp;','<':'&lt;','>':'&gt;','"':'&quot;',"'":'&#39;'}[c]));
for(const file of readdirSync(web).filter(x=>x.endsWith('.html'))){let text=readFileSync(new URL(file,web),'utf8');text=text.replace(/<footer>[\s\S]*?<\/footer>/,footer=>footer.includes('href="staff.html"')?footer:footer.replace('<a href="manual.html">','<a href="staff.html">Staff & contributors →</a><a href="manual.html">'));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];
const roster=data.staff.length?'<div class="staff-roster">'+data.staff.map(person=>'<article><h3>'+esc(person.displayName)+'</h3><p class="staff-role">'+esc(person.role)+'</p><p>'+esc(person.bio||'')+'</p></article>').join('')+'</div>':'<div class="staff-roster-note"><h3>Public roster awaiting confirmation</h3><p>No individual staff names have been confirmed for publication yet. Use the private support portal for help; this directory will list staff once their public details are supplied.</p></div>';
const contributor=data.contributor;
const page='<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Staff & Contributors — dunerealms.com</title><meta name="description" content="dunerealms.com staff support, public roster and clearly identified AI development credits."><link rel="icon" href="assets/favicon.svg">'+['styles','pages','minecraft','lore','staff'].map(x=>'<link rel="stylesheet" href="'+x+'.css">').join('')+'<script src="pages.js" defer></script></head><body><a class="skip" href="#staff-content">Skip to content</a>'+header+'<main><section class="page-intro intro-staff"><p class="eyebrow">dunerealms.com / THE ROCKHAVEN COUNCIL</p><h1>Staff & Contributors</h1><p>The people who support the community, and the development work behind the dunes.</p></section>'+menu+'<div id="staff-content" class="staff-content"><section class="staff-help"><div><p class="eyebrow">YOUR PRIVATE LINE TO STAFF</p><h2>Need a hand in the desert?</h2><p>For a ban appeal or account-specific help, open a private ticket under your player profile. Keep personal details in your ticket; public forum topics are visible to everyone.</p></div><div class="staff-help-links"><a class="button gold" href="tickets.html">Open support tickets →</a><a href="profile.html">Your player profile →</a><a href="discord.html">YouSMP Discord community →</a></div></section><section aria-labelledby="roster-heading"><p class="eyebrow">HUMAN COMMUNITY STAFF</p><h2 id="roster-heading">The staff roster</h2>'+roster+'<div class="staff-responsibilities"><article><h3>Player support</h3><p>Help requests and ban appeals are handled through private support tickets. Authorised staff can reply and update a case’s review status.</p></article><article><h3>Community moderation</h3><p>Public forum reports are reviewed by website moderators. Use the report action on the relevant post to provide context.</p></article><article><h3>Server administration</h3><p>Minecraft operators maintain the game server and plugin configuration. In-game rank, elected office and website staff access are separate roles.</p></article></div><p class="staff-small">Staff members can use the <a href="tickets.html?view=staff">support queue</a> after signing in with an authorised account.</p></section><section class="staff-ai" aria-labelledby="ai-heading"><div class="staff-medal"><img src="assets/dune-contributor-medal.svg" alt="Gold desert-style AI contributor medal for 2 of 14"><p>dunerealms.com<br>DEVELOPMENT RECOGNITION</p></div><div class="staff-ai-copy"><p class="eyebrow">AI CONTRIBUTOR · SEPARATE FROM HUMAN STAFF</p><h2 id="ai-heading">'+esc(contributor.name)+'</h2><p class="staff-designation">'+esc(contributor.designation)+'</p><p class="staff-role">'+esc(contributor.kind)+' · '+esc(contributor.platform)+'</p><p>'+esc(contributor.description)+'</p><p class="staff-ai-label">This is an AI contribution credit, not a player account or staff appointment. It grants no game or website permissions and is not a channel for handling support tickets.</p></div></section><section class="staff-contributions"><p class="eyebrow">TRACEABLE PROJECT HISTORY</p><h2>A record of contribution</h2><p>Selected repository changes document the work. These are contribution records rather than newly announced releases.</p><div class="staff-contribution-grid">'+data.contributions.map(x=>'<article><h3>'+esc(x.title)+'</h3><p>'+esc(x.description)+'</p><a href="https://github.com/thomasv6545-glitch/MC/commit/'+esc(x.commit)+'" target="_blank" rel="noopener">Repository change '+esc(x.commit)+' ↗</a></article>').join('')+'</div></section></div></main>'+footer+'<div class="toast" role="status" aria-live="polite"></div></body></html>';
writeFileSync(new URL('staff.html',web),page);console.log('Built staff page and public footer links; human roster entries:',data.staff.length);