samuel-philipp.de/src/_data/site.js

14 lines
475 B
JavaScript
Raw Normal View History

2024-04-01 16:02:49 +00:00
const fs = require("fs");
2023-05-08 22:16:46 +00:00
const site = require("./global.json");
2023-01-10 16:34:27 +00:00
2024-04-01 16:02:49 +00:00
site.buildName = process.env.BUILD || 'prod';
if (fs.existsSync(`${__dirname}/global.${site.buildName}.json`)) {
Object.assign(site, require(`./global.${site.buildName}.json`));
}
site.buildTime = new Date().toISOString();
2023-01-10 16:34:27 +00:00
site.lang = process.env.LANGUAGE || 'en';
site.language = site.languages.find(l => l.code === site.lang);
site.strings = require(`./i18n/${site.lang}.json`);
module.exports = site;