@@ -37,6 +37,7 @@ function readJson(file, fallback) {
3737 throw new Error ( `cannot read ${ file } : ${ err . message } ` , { cause : err } ) ;
3838 }
3939}
40+
4041function listMarkdown ( dir ) {
4142 if ( ! fs . existsSync ( dir ) ) throw new Error ( `content directory not found: ${ dir } ` ) ;
4243 return fs
@@ -91,8 +92,6 @@ export function buildVars(ctx, extra = {}) {
9192 } ;
9293}
9394
94- // ------------------------------------------------------ generated reference
95-
9695function code ( s ) {
9796 return `<code>${ escapeText ( s ) } </code>` ;
9897}
@@ -131,8 +130,6 @@ function makeInclude(ctx) {
131130 return ( name ) => ( table [ name ] ? table [ name ] ( ) : undefined ) ;
132131}
133132
134- // -------------------------------------------------------------------- guide
135-
136133export function buildGuide ( ctx ) {
137134 const dir = path . join ( ctx . root , "content/guide" ) ;
138135 const files = listMarkdown ( dir ) ;
@@ -196,8 +193,6 @@ function renderMarkdownInline(text, { file, vars }) {
196193 return r . html . replace ( / ^ < p > ( [ \s \S ] * ) < \/ p > $ / , "$1" ) ;
197194}
198195
199- // --------------------------------------------------------------------- home
200-
201196function docsGridHtml ( guide ) {
202197 const items = guide . groups
203198 . filter ( ( g ) => g . showOnHome )
@@ -237,17 +232,17 @@ export function buildHome(ctx, guide) {
237232 if ( type === "hero" ) {
238233 cards . push (
239234 `<section class="home-card home-card-hero">\n` +
240- `<a class="home-logo-link" href="/">\n<img class="home-logo" src="/favicon.svg" alt="CuffScript 로고" />\n</a>\n` +
241- `<h1>${ renderInline ( title ) } </h1>\n` +
242- ( data . slogan ? `<p class="home-slogan">${ renderInline ( String ( data . slogan ) ) } </p>\n` : "" ) +
243- `${ rendered } \n</section>` ,
235+ `<a class="home-logo-link" href="/">\n<img class="home-logo" src="/favicon.svg" alt="CuffScript 로고" />\n</a>\n` +
236+ `<h1>${ renderInline ( title ) } </h1>\n` +
237+ ( data . slogan ? `<p class="home-slogan">${ renderInline ( String ( data . slogan ) ) } </p>\n` : "" ) +
238+ `${ rendered } \n</section>` ,
244239 ) ;
245240 } else if ( type === "news" ) {
246241 cards . push (
247242 `<section class="home-card" id="${ id } ">\n<h2>${ renderInline ( title ) } </h2>\n${ rendered } \n` +
248- `<ul class="home-news-list" id="news-list"></ul>\n` +
249- `<p class="home-news-state" id="news-state">불러오는 중…</p>\n` +
250- `<p class="home-news-more">\n<a href="${ changelogUrl } " target="_blank" rel="noreferrer">전체 변경 이력 보기 →</a>\n</p>\n</section>` ,
243+ `<ul class="home-news-list" id="news-list"></ul>\n` +
244+ `<p class="home-news-state" id="news-state">불러오는 중…</p>\n` +
245+ `<p class="home-news-more">\n<a href="${ changelogUrl } " target="_blank" rel="noreferrer">전체 변경 이력 보기 →</a>\n</p>\n</section>` ,
251246 ) ;
252247 } else if ( type === "docs" ) {
253248 cards . push ( `<section class="home-card" id="${ id } ">\n<h2>${ renderInline ( title ) } </h2>\n${ rendered } \n${ docs . html } \n</section>` ) ;
@@ -260,8 +255,6 @@ export function buildHome(ctx, guide) {
260255 return { tocHtml : `<div class="home-toc-group">\n<h2>이 페이지</h2>\n${ toc . join ( "\n" ) } \n</div>` , cardsHtml : cards . join ( "\n" ) } ;
261256}
262257
263- // --------------------------------------------------------------- html shells
264-
265258const PLACEHOLDERS = {
266259 "<!--@guide:toc-->" : ( b ) => b . guide . tocHtml ,
267260 "<!--@guide:article-->" : ( b ) => b . guide . articleHtml ,
0 commit comments