Field notes: source to fresh output

HTML for this example

Select the code and use your copy shortcut. Changes in this preview are temporary.

<!doctype html>
<html lang="en-US"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Field notes: source to fresh output</title><style>*{box-sizing:border-box}body{margin:0;background:#f3f4f2;color:#202c32;font:16px/1.5 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}main{max-width:1120px;margin:auto;padding:30px 28px 60px}header{margin-bottom:22px}.eyebrow{font-size:12px;letter-spacing:.14em;text-transform:uppercase;font-weight:750;color:#59676b}h1{font-size:clamp(25px,4vw,36px);line-height:1.15;letter-spacing:-.035em;margin:7px 0 10px}h2{font-size:21px;line-height:1.3;margin:0 0 16px}h3{font-size:17px;margin:0 0 10px}p{margin:8px 0 16px}label{display:block;font-size:14px;font-weight:650;margin:12px 0 5px}input,select,textarea,button{font:inherit}input,select,textarea{width:100%;min-width:0;border:1px solid #b6c0bf;border-radius:7px;background:#fff;color:#202c32;padding:10px 12px}textarea{resize:vertical;min-height:88px}input[type=checkbox]{width:18px;height:18px;vertical-align:middle;margin-right:8px}button{border:1px solid #b8c3c1;border-radius:7px;padding:10px 15px;background:#fff;color:#203632;font-weight:650;cursor:pointer}button.primary{background:#243f3c;color:white;border-color:#243f3c}button:hover{filter:brightness(.95)}button:disabled{opacity:.48;cursor:not-allowed}:focus-visible{outline:3px solid #b05814;outline-offset:3px}.buttons{display:flex;gap:8px;flex-wrap:wrap;margin-top:18px}.panel{background:#fff;border:1px solid #d7ddda;border-radius:12px;padding:24px}.split{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.1fr);gap:22px}.row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.result{background:#e4eee8;border:1px solid #c5d6ca;border-radius:12px;padding:28px}.big{font-size:clamp(32px,5vw,56px);font-weight:740;line-height:1.14;letter-spacing:-.04em;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}.muted{color:#59686a;font-size:14px}.tag{display:inline-block;background:#edf0ed;border-radius:4px;padding:3px 8px;font-size:12px;font-weight:700}.error{color:#9d301b;font-weight:650;min-height:24px;margin-top:10px}.note{border-left:3px solid #9a794a;padding:10px 15px;background:#faf5e9;margin:18px 0}.below{margin-top:28px}.record{white-space:pre-wrap;overflow-wrap:anywhere;font:14px/1.65 ui-monospace,SFMono-Regular,Consolas,monospace;background:#f2f4f1;padding:18px;border-radius:8px}table{width:100%;border-collapse:collapse;font-size:14px}th,td{text-align:left;vertical-align:top;border-bottom:1px solid #dce1dd;padding:12px 10px;overflow-wrap:anywhere}th{color:#59686a;font-size:12px}a{color:#2c5a6a;overflow-wrap:anywhere}details{margin-top:20px}summary{cursor:pointer;font-weight:650}hr{border:0;border-top:1px solid #d6dcd6;margin:22px 0}[hidden]{display:none!important}ol,ul{padding-left:23px}.statline{display:flex;gap:20px;flex-wrap:wrap;margin:18px 0}.statline strong{display:block;font-size:24px}.inline{display:flex;align-items:center;gap:8px}.inline label{margin:0} .blank{min-height:36px;border-bottom:1px dashed #aebbb5;color:#66736d;font-size:13px;padding:8px 0}@media(max-width:720px){main{padding:22px 18px 45px}.split{grid-template-columns:1fr}.panel,.result{padding:20px}.row{gap:12px}th,td{padding:10px 6px}}@media(max-width:400px){main{padding:18px 14px 40px}.big{font-size:34px}button{padding:10px 12px}.row{grid-template-columns:1fr}.panel,.result{padding:17px}}.inline{flex-wrap:wrap}input[type=range]{padding:0}pre{white-space:pre-wrap;overflow-wrap:anywhere;margin:0}.metric{font-size:42px;font-weight:750;line-height:1.15;letter-spacing:-.035em}.caption{font-size:13px;color:#55656b}.readout{font:15px/1.6 ui-monospace,Consolas,monospace;white-space:pre-wrap;overflow-wrap:anywhere}.strip{display:flex;gap:24px;align-items:center;flex-wrap:wrap}.chip{padding:5px 10px;background:#e5eaf0;border-radius:5px;font-size:13px}button[aria-pressed=true]{background:#263b50;color:white}.subtle{background:#f6f7f7}.fileCode{min-height:230px;font:14px/1.6 ui-monospace,Consolas,monospace}.wideButton{width:100%}.visuallyHidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}svg{max-width:100%}.nowrap{white-space:nowrap}.projectResult{display:grid;grid-template-columns:1fr 1fr;gap:28px;padding:25px;border:1px solid #ced4df;border-radius:12px;background:#e8eaf3}.projectResult h2{font-size:29px;line-height:1.3;margin:10px 0}.expected{background:#fff;border:1px solid #d3d7e3;border-radius:8px;padding:18px}.expected pre{font:16px/1.8 ui-monospace,Consolas,monospace;margin:12px 0}.sourceExplorer{display:grid;grid-template-columns:235px minmax(0,1fr);gap:18px}#files{display:flex;flex-direction:column;gap:8px}#files button{text-align:left;font:13px/1.5 ui-monospace,Consolas,monospace;padding:12px;overflow-wrap:anywhere}.sourceExplorer h2{font:16px ui-monospace,Consolas,monospace;margin:0;overflow-wrap:anywhere}.sourceExplorer .strip{justify-content:space-between;margin-bottom:15px}.sourceExplorer .panel{padding:20px}@media(max-width:760px){.projectResult{grid-template-columns:1fr;gap:12px;padding:20px}.sourceExplorer{grid-template-columns:1fr}#files{display:grid;grid-template-columns:1fr 1fr}.projectResult h2{font-size:25px}}@media(max-width:400px){#files{grid-template-columns:1fr}}</style></head><body><main><header><div class="eyebrow">Hugo project packet · Build evidence stays separate</div><h1>Field notes: source to fresh output</h1></header>
<section class="projectResult"><div><span class="eyebrow">Ready-to-copy native source</span><h2>Welcome is public.<br>Pending stays a draft.</h2><p>Six original files map content → base → home/page templates.</p></div><div class="expected"><span class="eyebrow">Expected normal-build routes</span><pre>/index.html
/welcome/index.html</pre><p class="caption">/pending/index.html excluded · Expected output, not a build log</p></div></section>
<section class="sourceExplorer below"><nav id="files" aria-label="Project source files"></nav><div class="panel"><div class="strip"><h2 id="fileName"></h2><button id="download">Show selected file to copy</button></div><label class="visuallyHidden" for="code">Selected original source file</label><textarea class="fileCode" id="code" readonly rows="13" spellcheck="false"></textarea><p id="downloadStatus" class="muted" role="status"></p></div></section>
<section class="panel below"><h2>Plan a separate destination for each run</h2><div class="row"><div><label for="mode">Acceptance context</label><select id="mode"><option value="normal">Normal build · drafts excluded</option><option value="drafts">Draft-including preview artifacts</option></select></div><div><label for="destination">New isolated output directory</label><input id="destination" value="./out/normal-run-01" spellcheck="false"></div></div><label for="command">Planned command · does not execute here</label><textarea id="command" class="readout" readonly rows="2"></textarea><p id="expected" class="muted"></p><label for="version">Actual Hugo version / environment · record after checking locally</label><input id="version" placeholder="Not supplied"><label for="observed">Paths from your actual fresh artifact manifest · one per line</label><textarea id="observed" rows="5" placeholder="index.html&#10;welcome/index.html"></textarea><div class="buttons"><button id="check" class="primary">Check supplied path list</button></div><p id="feedback" class="error" role="status"></p><pre id="checkResult" class="record">No actual artifact evidence supplied.</pre></section>
<section class="panel below"><h2>Finish acceptance in the native project</h2><p>Confirm that the selected base appears, each page title and authored Introduction render once, and generated links reach the output HTML. Check Pending's route, home link and body absence in a fresh normal build.</p><p class="muted">This packet generates source text and checks supplied path lists. It does not run Hugo, inspect local files or establish deployment. Record actual command, source/config hashes, new destination, logs and artifact hashes in the maintained manifest. Other support artifacts may exist. Do not delete a shared output folder to obtain freshness.</p><p class="muted">Reviewed quick-start requirement: Hugo v0.158.0 or later; actual installed version must be checked. Current layouts use baseof.html, home.html and page.html. Child templates contain a matching main definition, with no loose outer markup.</p><a href="https://gohugo.io/templates/types/">Hugo template types</a> · <a href="https://gohugo.io/getting-started/quick-start/">Quick start and draft behavior</a></section><footer class="muted below">Local working copy · Changes are not saved after this page closes.</footer></main><script data-app>
(()=>{
const $=id=>document.getElementById(id);const text=(id,v)=>$(id).textContent=String(v);const on=(id,type,fn)=>$(id).addEventListener(type,fn);const escapeHTML=s=>String(s).replace(/[&<>"']/g,c=>({'&':'&amp;','<':'&lt;','>':'&gt;','"':'&quot;',"'":'&#39;'}[c]));const decimal=s=>{const raw=String(s).trim();if(!/^[0-9]+(?:[.][0-9]{1,6})?$/.test(raw)||!Number.isFinite(+raw)||+raw>1000000)throw Error('Use a number from 0 to 1,000,000 with at most six decimal places. Blank is missing.');return +raw};const display=n=>n>0&&n<0.000001?n.toExponential(6):Number(n.toFixed(6)).toString();const download=(filename,content,type='text/plain')=>{let panel=document.getElementById('manualCopyPanel');if(!panel){panel=document.createElement('section');panel.id='manualCopyPanel';panel.className='panel below';panel.style.cssText='max-width:100%;margin:24px 0';const heading=document.createElement('h2');heading.id='manualCopyName';const hint=document.createElement('p');hint.textContent='Select the content below, then press Ctrl+C or Command+C to copy it into your own file. This preview does not download files.';const area=document.createElement('textarea');area.id='manualCopyContent';area.readOnly=true;area.rows=12;area.spellcheck=false;area.setAttribute('aria-label','Generated file content to copy');area.style.cssText='display:block;width:100%;max-width:100%;box-sizing:border-box;font:13px/1.5 ui-monospace,monospace';const select=document.createElement('button');select.type='button';select.id='manualCopySelect';select.textContent='Select content';select.addEventListener('click',()=>{area.focus();area.select();});panel.append(heading,hint,area,select);(document.querySelector('main')||document.body).append(panel);}document.getElementById('manualCopyName').textContent=String(filename);const area=document.getElementById('manualCopyContent');area.value=String(content);area.dataset.mimeType=String(type);panel.scrollIntoView({block:'nearest'});area.focus();area.select();};

const sources={
'hugo.toml':'baseURL = "https://example.invalid/"\nlocale = "en-us"\ntitle = "Field notes"\n',
'content/welcome.md':'+++\ntitle = "Welcome"\ndraft = false\n+++\n\n## Introduction\n\nKeep field observations with their source.\n',
'content/pending.md':'+++\ntitle = "Pending"\ndraft = true\n+++\n\n## Introduction\n\nReview this note before release.\n',
'layouts/baseof.html':'<!doctype html>\n<html lang="en-US">\n<head>\n  <meta charset="utf-8">\n  <meta name="viewport" content="width=device-width,initial-scale=1">\n  <title>{{ .Title }} | Field notes</title>\n</head>\n<body>\n  <header><a href="{{ site.Home.RelPermalink }}">Field notes</a></header>\n  <main>{{ block "main" . }}{{ end }}</main>\n</body>\n</html>\n',
'layouts/home.html':'{{ define "main" }}\n<section aria-labelledby="notes-title">\n  <h1 id="notes-title">Field notes</h1>\n  <p>Read the notes included in this build.</p>\n  <ul>\n    {{ range .Site.RegularPages.ByTitle }}\n      <li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>\n    {{ end }}\n  </ul>\n</section>\n{{ end }}\n',
'layouts/page.html':'{{ define "main" }}\n<article>\n  <h1>{{ .Title }}</h1>\n  {{ .Content }}\n</article>\n{{ end }}\n'};let selected='content/welcome.md';
function selectFile(name){if(!Object.hasOwn(sources,name))throw Error('Unknown source file');selected=name;text('fileName',name);$('code').value=sources[name];for(const button of $('files').querySelectorAll('button'))button.setAttribute('aria-pressed',String(button.dataset.file===name));text('downloadStatus','')}
function plan(mode,destination){if(!['normal','drafts'].includes(mode))throw Error('Choose a build context.');if(!/^[.][/][A-Za-z0-9_/-]+$/.test(destination)||destination.includes('..'))throw Error('Use a new relative directory such as ./out/normal-run-02; avoid spaces and traversal.');return {command:'hugo '+(mode==='drafts'?'--buildDrafts ':'')+'--destination '+destination,required:mode==='drafts'?['index.html','welcome/index.html','pending/index.html']:['index.html','welcome/index.html'],excluded:mode==='normal'?['pending/index.html']:[]}}
function renderPlan(){text('feedback','');text('checkResult','Path evidence changed. Check the supplied manifest again.');try{const p=plan($('mode').value,$('destination').value);$('command').value=p.command;text('expected',($('mode').value==='normal'?'Expected: Welcome only.':'Expected: Welcome and Pending; pending.md stays draft true.')+' Deployment evidence: not supplied.')}catch(e){$('command').value='';text('feedback',e.message)}}
function inspect(raw,mode){if(!raw.trim())throw Error('Paste actual fresh output paths first.');const paths=[...new Set(raw.split(/\r?\n/).map(s=>s.trim().replace(/^\.\//,'').replace(/^\//,'')).filter(Boolean))];const p=plan(mode,'./out/check-only');return {missing:p.required.filter(x=>!paths.includes(x)),unexpectedDraft:mode==='normal'&&paths.some(x=>x==='pending'||x.startsWith('pending/')),paths}}
$('files').innerHTML=Object.keys(sources).map(name=>'<button data-file="'+name+'" aria-pressed="false">'+name+'</button>').join('');on('files','click',e=>{if(e.target.dataset.file)selectFile(e.target.dataset.file)});on('download','click',()=>{download(selected.split('/').at(-1),sources[selected]);text('downloadStatus','Selected source text shown below for manual copying. Place it at '+selected+' in your native project.')});on('mode','change',renderPlan);on('destination','input',renderPlan);on('observed','input',()=>text('checkResult','Path evidence changed. Check again.'));on('check','click',()=>{text('checkResult','—');try{plan($('mode').value,$('destination').value);const r=inspect($('observed').value,$('mode').value);text('checkResult','Supplied-path check only\nMissing required routes: '+(r.missing.join(', ')||'none')+'\nUnexpected draft route: '+(r.unexpectedDraft?'yes':'no')+'\nVersion/environment: '+($('version').value||'not supplied')+'\nFreshness, file contents, base/template selection, links and deployment: NOT VERIFIED');text('feedback',r.missing.length||r.unexpectedDraft?'Resolve the reported path mismatch.':'Supplied paths match the expected authored-page routes. Content and freshness checks remain.')}catch(e){text('feedback',e.message)}});window.app={sources,plan,inspect,selectFile};selectFile(selected);renderPlan();text('checkResult','No actual artifact evidence supplied.');
})();
</script></body></html>