include pages/family.pug
include pages/index.pug
include pages/source.pug
include pages/old.pug
-
const fs = require('fs');
const utils = require(`${__dirname}/public/scripts/lib/utils.js`);
// All the data files
let files = fs.readdirSync(`${__dirname}/public/data`).filter(file => file.endsWith('.json'));
let data = [];
// Get pages data
files.forEach(function(file) {
data.push(require(`${__dirname}/public/data/${file}`));
});
// Sort pages
data.sort(function(a, b) {
if (a.name == 'home' || (a.type == 'family' && b.type != 'family')) {
return -1;
}
return 0;
})
mixin pages(name)
each info in data
if info.name != name
.slider__slide.slider__slide_frame
a.frame.frame_page(href=`/${info.name == 'home' ? '' : info.name}`, data-name=info.name, data-start=info.colors.start, data-end=info.colors.end)
if info.animated
.body.body_contained(class!=`body_page_${info.name}`, id!=`${info.name}-page`)
if info.name == 'home'
+index-contained(info)
if info.type == 'family'
+family-contained(info)
else if info.name == 'source'
+source-contained(info)
else if info.name == 'old'
+old-contained(info)
else
img(src=`/public/images/site/pages/${info.name}.jpg`, alt=info.name)
.frame__title= info.title