added meta tag data to page render method, added page display limiter to dash index

pull/20/head
Ro 5 years ago
parent 7243e5ec32
commit c2517997c7

@ -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(() => {

@ -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 = [];

Loading…
Cancel
Save