From c2517997c7a0321101c5a02278b6d8af4c74b904 Mon Sep 17 00:00:00 2001 From: Ro Date: Thu, 28 May 2020 16:13:52 -0700 Subject: [PATCH] added meta tag data to page render method, added page display limiter to dash index --- brain/data/Render.js | 3 ++- brain/routes/dash/index.js | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/brain/data/Render.js b/brain/data/Render.js index a0dbe79..bfa1e2c 100644 --- a/brain/data/Render.js +++ b/brain/data/Render.js @@ -65,7 +65,8 @@ export default class Render { let file = pug.renderFile(template, { title: page.metadata.title, default_bg: page.metadata.feature, - content: html + content: html, + tags: page.metadata.tags }); fs.ensureDir(path).then(() => { diff --git a/brain/routes/dash/index.js b/brain/routes/dash/index.js index 323f51a..5af8614 100644 --- a/brain/routes/dash/index.js +++ b/brain/routes/dash/index.js @@ -3,6 +3,7 @@ const express = require('express'); const router = express.Router(); const config = require('../../../site/settings.json'); const book = new Book(); +const indexLimit = 5; //-------------------------- // Index @@ -11,9 +12,12 @@ router.get('/', function (req, res) { book.getPage().then(result => { result.sort((a, b) => parseFloat(b.metadata.id) - parseFloat(a.metadata.id)); let indexPages = []; + let indexCount = 0; result.forEach(page => { if (typeof page.metadata.deleted === 'undefined' || page.metadata.deleted === false) { + if (indexCount === indexLimit) return; indexPages.push(page); + ++indexCount; } }); let pageData = [];