mirror of
https://github.com/mediacms-io/mediacms.git
synced 2025-05-02 19:24:33 +02:00
* Added frontend development files/environment * More items-categories related removals * Improvements in pages templates (inc. static pages) * Improvements in video player * Added empty home page message + cta * Updates in media, playlist and management pages * Improvements in material icons font loading * Replaced media & playlists links in frontend dev-env * frontend package version update * chnaged frontend dev url port * static files update * Changed default position of theme switcher * enabled frontend docker container
37 lines
929 B
TypeScript
Executable File
37 lines
929 B
TypeScript
Executable File
const fs = require('fs');
|
|
const path = require('path');
|
|
|
|
const ejs = require('ejs');
|
|
|
|
const templatePath = path.join(__dirname, '../templates');
|
|
const sitemapTemplatePath = path.join(templatePath, 'sitemap.ejs');
|
|
|
|
const sitemapTemplate = ejs.compile(fs.readFileSync(sitemapTemplatePath, 'utf8'), { root: [templatePath], filename: sitemapTemplatePath, outputFunctionName: 'echo' });
|
|
|
|
import { ConfigPages } from '../config';
|
|
|
|
export default function pagesConfig(pagesKeys: string[]): ConfigPages {
|
|
|
|
const pages: ConfigPages = {};
|
|
|
|
if (-1 === pagesKeys.indexOf('sitemap')) {
|
|
|
|
pages.sitemap = {
|
|
staticPage: true,
|
|
buildExclude: true,
|
|
title: 'Sitemap',
|
|
filename: 'sitemap.html',
|
|
html: {
|
|
head: {},
|
|
body: {
|
|
scripts: [],
|
|
snippet: sitemapTemplate({ pages: [...pagesKeys, ...Object.keys(pages)] }),
|
|
},
|
|
},
|
|
window: {},
|
|
render: ''
|
|
};
|
|
}
|
|
|
|
return pages;
|
|
} |