diff --git a/build.js b/build.js index 4ffdc2fb..5c6bf32c 100644 --- a/build.js +++ b/build.js @@ -39,7 +39,7 @@ module.exports = { buildBanners: async(board) => { console.log('building banners', `${board._id}/banners.html`); return render(`${board._id}/banners.html`, 'banners.pug', { - board: board + board: board, }); }, @@ -51,7 +51,7 @@ console.log('building catalog', `${board._id}/catalog.html`); const threads = await Posts.getCatalog(board._id); return render(`${board._id}/catalog.html`, 'catalog.pug', { board, - threads + threads, }); }, @@ -69,7 +69,7 @@ console.log('building thread', `${board._id || board}/thread/${threadId}.html`); return render(`${board._id}/thread/${threadId}.html`, 'thread.pug', { board, - thread + thread, }); }, @@ -89,7 +89,7 @@ console.log('building board page', `${board._id}/${page === 1 ? 'index' : page}. board, threads, maxPage, - page + page, }); }, @@ -132,7 +132,7 @@ console.log('multi building board pages', `${board._id}/ ${startpage === 1 ? 'in buildHomepage: async () => { const boards = await Boards.find(); return render('index.html', 'home.pug', { - boards + boards, }); }, diff --git a/gulp/res/css/style.css b/gulp/res/css/style.css index 148a6dc6..990796aa 100644 --- a/gulp/res/css/style.css +++ b/gulp/res/css/style.css @@ -119,6 +119,10 @@ object { box-sizing: border-box; } +p { + margin: 5px; +} + .no-m-p { margin: 0px; padding: 0px; @@ -220,7 +224,7 @@ pre a, pre a:visited, a:hover { background: #D6DAF0; border: 1px solid #000333; border-spacing: 0; - width: 800px; + width: 600px; } .table-head { @@ -587,7 +591,7 @@ hr { color: lightgray; } -@media only screen and (max-width: 800px) { +@media only screen and (max-width: 600px) { input, .postform-style { height: 30px; diff --git a/helpers/render.js b/helpers/render.js index 168a29ba..2795450c 100644 --- a/helpers/render.js +++ b/helpers/render.js @@ -8,6 +8,6 @@ const { cacheTemplates, openGraph }= require(__dirname+'/../configs/main.json') , templateDirectory = path.join(__dirname+'/../views/pages/'); module.exports = async (htmlName, templateName, options) => { - const html = pug.renderFile(`${templateDirectory}${templateName}`, { ...options, renderStart: Date.now(), cache: cacheTemplates, openGraph: openGraph }); + const html = pug.renderFile(`${templateDirectory}${templateName}`, { ...options, cache: cacheTemplates, openGraph: openGraph }); return outputFile(`${uploadDirectory}html/${htmlName}`, html); }; diff --git a/views/includes/footer.pug b/views/includes/footer.pug index bee5fadc..ac7fe3ac 100644 --- a/views/includes/footer.pug +++ b/views/includes/footer.pug @@ -1,5 +1,4 @@ small.footer | - a(href='https://github.com/fatchan/jschan/') source code - - const ms = Date.now()-renderStart - span + took #{ms > 0 ? ms/1000 : 0}s - + | - diff --git a/views/pages/home.pug b/views/pages/home.pug index c82599ba..c7d7a6bc 100644 --- a/views/pages/home.pug +++ b/views/pages/home.pug @@ -5,7 +5,22 @@ block head block content h1.board-title Imageboard - h4.board-description Board list + .table-container.flex-center.mv-10 + table.table-body + tr.table-head + th Welcome + tr.table-row + td + p + | This is an anonymous imageboard, a discussion board/BBS where users share text or images about various topics. + p + | The most notable feature of imageboards and primary difference to traditional forums is + | that anybody can make a post without the need to register an account or provide + | any personal information. This way, what is said becomes more important than who says it. + | As new threads are started, the least recently replied to are pruned. This creates an + | element of transience and keeps making room for new content. + p + | Pick a board below to join the discussion. .table-container.flex-center.mv-10 table.table-body tr.table-head @@ -15,5 +30,15 @@ block content each board in boards tr.table-row td: a(href=`/${board._id}/`) /#{board._id}/ - td #{board.name} - td #{board.description} + td #{board.settings.name} + td #{board.settings.description} + .table-container.flex-center.mv-10 + table.table-body + tr.table-head + th Source Code + tr.table-row + td + p + | The source code for this site is available + a(href='https://github.com/fatchan/jschan/') here + | and is licensed under the Affero General Public License v3.