@@ -2,7 +2,7 @@ import fs from 'fs';
22import path from 'path' ;
33import fm from "front-matter" ;
44import yaml from 'js-yaml' ;
5- import { chunkContent , getLinesPerPage , getCharsPerLine , PaginationConfig } from './utils/markdown-chunker' ;
5+ import { chunkContent , getCharsPerPage , PaginationConfig } from './utils/markdown-chunker' ;
66import { loadTheme } from './utils/theme-loader' ;
77
88const publicDir = path . join ( __dirname , '..' , 'public' ) ;
@@ -14,22 +14,18 @@ const configPath = path.join(publicDir, 'config.yaml');
1414const configRaw = fs . readFileSync ( configPath , 'utf-8' ) ;
1515const config = yaml . load ( configRaw ) as any ;
1616
17- // Load theme scale
1817const themeName = config ?. theme || 'journal' ;
1918const theme = loadTheme ( themeName ) ;
2019const themeScale = theme ?. font ?. scale ?? 1 ;
2120
22- // Build pagination config
2321const paginationConfig : PaginationConfig = {
2422 columns : config ?. reader ?. columns ?? 2 ,
25- linesPerPage : config ?. reader ?. linesPerPage ,
2623 pagination : config ?. reader ?. pagination ,
2724} ;
2825
29- const LINES_PER_PAGE = getLinesPerPage ( paginationConfig , themeScale ) ;
30- const CHARS_PER_LINE = getCharsPerLine ( paginationConfig , themeScale ) ;
26+ const CHARS_PER_PAGE = getCharsPerPage ( paginationConfig , themeScale ) ;
3127
32- console . log ( `[pagination]: theme=${ themeName } , scale=${ themeScale } , linesPerPage =${ LINES_PER_PAGE } , charsPerLine= ${ CHARS_PER_LINE } ` ) ;
28+ console . log ( `[pagination]: theme=${ themeName } , scale=${ themeScale } , charsPerPage =${ CHARS_PER_PAGE } ` ) ;
3329
3430type PiecePage = {
3531 pieceSlug : string ;
@@ -63,7 +59,7 @@ piecesIndex.forEach((piece: any) => {
6359 const parsed = fm ( raw ) ;
6460 const content = parsed . body ;
6561
66- const chunks = chunkContent ( content , LINES_PER_PAGE , CHARS_PER_LINE ) ;
62+ const chunks = chunkContent ( content , CHARS_PER_PAGE ) ;
6763 const totalPages = chunks . length ;
6864
6965 const pages : PiecePage [ ] = chunks . map ( ( chunk , index ) => ( {
0 commit comments