${escape(work.title)}
${dateLabel(work,lang)}${work.date&&(!publicRelease||work.publicDisplay?.attribution==='medium')?`${t.sourceDate}`:''}
— MrPresent-Han
import { renderCards } from './cards.mjs'; const escape = value => String(value).replace(/[&<>"']/g,c=>({'&':'&','<':'<','>':'>','"':'"',"'":'''}[c])); const locale = language => language==='zh-Hans'?'zh':'en'; const url = work => `/${locale(work.language)}/essays/${work.slug}/`; const draftLabel = lang => lang==='zh'?'私有草稿':'Private draft'; const dateLabel = (work,lang) => work.date?``:work.publicDisplay?'':`${draftLabel(lang)}`; const labels={ en:{selected:'Selected',topics:'Topics',archive:'Archive',home:'Selected writing',intro:'Engineering AI infrastructure, compute, and storage for correctness, performance, and reliability at scale—grounded in production experience.',preview:'Local preview · Not published',all:'All articles',read:'Reading paths',recent:'From the archive',empty:'No articles in this preview.',original:'English original',sourceDate:'First published on Medium',back:'All articles',series:'Storage–compute separation',nav:'Main navigation',skip:'Skip to content'}, zh:{selected:'精选',topics:'专题',archive:'归档',home:'精选文章',intro:'立足生产一线,剖析 AI 基础设施、计算与存储的系统设计,探究大规模运行下的正确性、性能与稳定性。',preview:'本地预览 · 未发布',all:'全部文章',read:'专题阅读',recent:'归档选读',empty:'当前预览暂无文章。',original:'英文原稿',sourceDate:'首次发表于 Medium',back:'全部文章',series:'存算分离',nav:'主导航',skip:'跳到正文'} }; const topicNames={ performance:{en:'Performance & memory',zh:'性能与内存'}, systems:{en:'Storage & coordination',zh:'存储与协调'}, debugging:{en:'Production debugging',zh:'线上故障诊断'} }; const evidenceNames={ 'engineering-record':{en:'Engineering record',zh:'工程实录'}, 'design-analysis':{en:'Design analysis',zh:'设计分析'}, hypothesis:{en:'Hypothesis',zh:'研究假设'} }; function shell({lang='en',title,active,content,alternate,article=false,publicRelease=false}) { const t=labels[lang]; const other=lang==='en'?'zh':'en'; const links=[['selected',`/${lang}/`],['topics',`/${lang}/topics/`],['archive',`/${lang}/archive/`]]; const alt=alternate?`${other==='zh'?'中文':'EN'}`:''; return `
${publicRelease?'':''}${escape(t.intro)}
${labels[lang].empty}
`; return `${t.empty}
`:''}`})); for(const [key,name] of Object.entries(topicNames)) { const group=entries.filter(w=>w.topic===key); if(!group.length)continue; const series=group.filter(w=>w.seriesOrder).sort((a,b)=>a.seriesOrder-b.seriesOrder); pages.set(`/${lang}/topics/${key}/`,renderShell({lang,title:name[lang],active:'topics',alternate:!publicRelease||works.some(w=>locale(w.language)===other&&w.topic===key)?`/${other}/topics/${key}/`:null,content:`${t.topics}${t.empty}
`}`})); } for(const work of works) { const lang=locale(work.language), t=labels[lang]; const alternate=works.find(w=>w.id===work.id&&w.language!==work.language); const series=works.filter(w=>w.seriesOrder&&w.language===work.language).sort((a,b)=>a.seriesOrder-b.seriesOrder); pages.set(url(work),renderShell({lang,title:work.title,article:true,alternate:alternate?url(alternate):null,content:` ${t.back}${dateLabel(work,lang)}${work.date&&(!publicRelease||work.publicDisplay?.attribution==='medium')?`${t.sourceDate}`:''}
— MrPresent-Han
${publicRelease?(lang==='zh'?'参考材料未公开;相关引用仅显示标题。':'Reference materials are not public; their titles are shown without links.'):(lang==='zh'?'文中参考草稿未纳入本次预览;相关引用仅显示标题。':'Linked reference drafts are not included in this preview; their titles are shown without links.')}
`:''} ${work.seriesOrder?``:''}`})); } pages.set('/',pages.get(`/${locales[0]}/`)); pages.set('/404.html',renderShell({lang:locales[0],title:'Page not found',content:`${publicRelease?'Page unavailable.':'This page is not part of the local preview.'}
Selected writing