add some homepage info, and remove inaccurate renderstart from foot

merge-requests/208/head
fatchan 5 years ago
parent e54e30c586
commit 5da9e123c0
  1. 10
      build.js
  2. 8
      gulp/res/css/style.css
  3. 2
      helpers/render.js
  4. 3
      views/includes/footer.pug
  5. 31
      views/pages/home.pug

@ -39,7 +39,7 @@ module.exports = {
buildBanners: async(board) => { buildBanners: async(board) => {
console.log('building banners', `${board._id}/banners.html`); console.log('building banners', `${board._id}/banners.html`);
return render(`${board._id}/banners.html`, 'banners.pug', { 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); const threads = await Posts.getCatalog(board._id);
return render(`${board._id}/catalog.html`, 'catalog.pug', { return render(`${board._id}/catalog.html`, 'catalog.pug', {
board, 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', { return render(`${board._id}/thread/${threadId}.html`, 'thread.pug', {
board, board,
thread thread,
}); });
}, },
@ -89,7 +89,7 @@ console.log('building board page', `${board._id}/${page === 1 ? 'index' : page}.
board, board,
threads, threads,
maxPage, maxPage,
page page,
}); });
}, },
@ -132,7 +132,7 @@ console.log('multi building board pages', `${board._id}/ ${startpage === 1 ? 'in
buildHomepage: async () => { buildHomepage: async () => {
const boards = await Boards.find(); const boards = await Boards.find();
return render('index.html', 'home.pug', { return render('index.html', 'home.pug', {
boards boards,
}); });
}, },

@ -119,6 +119,10 @@ object {
box-sizing: border-box; box-sizing: border-box;
} }
p {
margin: 5px;
}
.no-m-p { .no-m-p {
margin: 0px; margin: 0px;
padding: 0px; padding: 0px;
@ -220,7 +224,7 @@ pre a, pre a:visited, a:hover {
background: #D6DAF0; background: #D6DAF0;
border: 1px solid #000333; border: 1px solid #000333;
border-spacing: 0; border-spacing: 0;
width: 800px; width: 600px;
} }
.table-head { .table-head {
@ -587,7 +591,7 @@ hr {
color: lightgray; color: lightgray;
} }
@media only screen and (max-width: 800px) { @media only screen and (max-width: 600px) {
input, .postform-style { input, .postform-style {
height: 30px; height: 30px;

@ -8,6 +8,6 @@ const { cacheTemplates, openGraph }= require(__dirname+'/../configs/main.json')
, templateDirectory = path.join(__dirname+'/../views/pages/'); , templateDirectory = path.join(__dirname+'/../views/pages/');
module.exports = async (htmlName, templateName, options) => { 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); return outputFile(`${uploadDirectory}html/${htmlName}`, html);
}; };

@ -1,5 +1,4 @@
small.footer small.footer
| - | -
a(href='https://github.com/fatchan/jschan/') source code a(href='https://github.com/fatchan/jschan/') source code
- const ms = Date.now()-renderStart | -
span + took #{ms > 0 ? ms/1000 : 0}s -

@ -5,7 +5,22 @@ block head
block content block content
h1.board-title Imageboard 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-container.flex-center.mv-10
table.table-body table.table-body
tr.table-head tr.table-head
@ -15,5 +30,15 @@ block content
each board in boards each board in boards
tr.table-row tr.table-row
td: a(href=`/${board._id}/`) /#{board._id}/ td: a(href=`/${board._id}/`) /#{board._id}/
td #{board.name} td #{board.settings.name}
td #{board.description} 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.

Loading…
Cancel
Save