// single-post.jsx — 単一記事 (HBR 風 editorial layout) // PHP 側で window.HB_POST = { // en, jp_label, title, content_html, date, thumbnail, summary, // archive_url, archive_label, related: [{id,title,date,permalink,thumbnail}], // cats: [{name,url}], tags: [{name,url}], // author: {name,avatar,bio} | null // } を注入する前提 // // レイアウト方針 (HBR articleモデル): // - 記事カラム幅 720px に統一(画像も本文も同じ幅で「詰まった編集記事」の質感) // - H1 は Mincho 系 serif で大きめ・行間広め // - 冒頭に「この記事のポイント (Summary)」box(無ければ非表示) // - 著者 byline は冒頭+末尾の2回表示(HBR 流) // - sticky TOC は右レール、本文と並列 (function(){ const { HBLayout, hbcp, fontEN, fontENSans, fontJP, fontMono, HB_BASE } = window; // 編集メディア向け Serif フォントスタック(タイトル・H2 用) const fontSerif = '"Shippori Mincho","Hiragino Mincho ProN","Yu Mincho",serif'; function SinglePostPage() { const d = window.HB_POST || {}; const { en='Article', jp_label='記事', title='', content_html='', date='', thumbnail='', summary='', archive_url='#', archive_label='一覧へ戻る', related=[], cats=[], tags=[], author=null, } = d; const articleRef = React.useRef(null); const [toc, setToc] = React.useState([]); const [shareUrl, setShareUrl] = React.useState(''); React.useEffect(() => { try { setShareUrl(window.location.href); } catch(e){} const root = articleRef.current; if (!root) return; const items = []; root.querySelectorAll('h2, h3').forEach((h, i) => { if (!h.id) h.id = `hb-h-${i}`; items.push({ id: h.id, level: h.tagName === 'H2' ? 2 : 3, text: h.textContent }); }); setToc(items); }, [content_html]); return ( {/* ===== Article header (kicker + H1 + byline) ===== */}
{/* Breadcrumb */} {/* Topic kicker(HBR 流:H1 上に小さく分野表示) */} {cats[0] && ( {cats[0].name} )} {/* Serif 大型 H1 */}

{title}

{/* Byline (date + author) */}
{author && author.avatar && ( )}
{author && {author.name}} {author && ·} {date}
{/* Hero image — 本文カラムと同じ 720px 幅で控えめに */} {thumbnail && (
)}
{/* ===== Article body (with right-rail TOC on PC) ===== */}
0 ? 'minmax(0,720px) 220px' : 'minmax(0,720px)', gap:64, alignItems:'flex-start', justifyContent:'center'}}>
{/* Summary box (この記事のポイント) — HBR 流の TL;DR 配置 */} {summary && summary.trim() && (
● SUMMARY
)}
{/* Author bio(記事末尾。HBR 流の "About the author" box) */} {author && author.bio && (
{author.avatar && }
● ABOUT THE AUTHOR

{author.name}

{author.bio}

)}
{toc.length > 0 && ( )}
{/* ===== Tags + Share ===== */}
{tags.length > 0 ? (
TOPICS
{tags.map(t => ( #{t.name} ))}
) :
}
SHARE
𝕏 f
{/* ===== End CTA ===== */}
● CONTACT

記事の内容について、もっと詳しく聞いてみる。

kintone・会計・AI・編集の現場の話を、30分・無料で具体的に伺います。

無料相談を予約する サービス資料を請求する
{/* ===== Related ===== */} {related.length > 0 && (
Related 関連記事
{related.map(r => ( {r.thumbnail && (
)}
{r.date}

{r.title}

))}
)}
); } Object.assign(window, { SinglePostPage }); })();