// Grab ?id=XXX const params=new URLSearchParams(window.location.search); const id=params.get('id'); const container=document.getElementById('project'); if(!id){ container.textContent='No project id 🙃'; throw new Error('Missing id param'); } fetch('projects/projects.json') .then(r=>r.json()) .then(list=>{ const proj=list.find(p=>p.id===id); if(!proj) throw new Error('Unknown project'); container.innerHTML=`
${txt.replace(/\n/g,'
')}
Project not found.
'; });