updated siteConfig to separate custom containers, components, and pages

This commit is contained in:
bill bittner 2018-03-31 17:49:19 -07:00
parent 2c48d22add
commit ba01ce8e68
4 changed files with 4229 additions and 14 deletions

View file

@ -10,11 +10,9 @@ function SiteConfig () {
this.auth = { this.auth = {
sessionKey: 'default', sessionKey: 'default',
}; };
this.customComponents = { this.customComponents = {};
components: {}, this.customContainers = {};
containers: {}, this.customPages = {};
pages : {},
};
this.details = { this.details = {
description: 'Open-source, decentralized image and video sharing.', description: 'Open-source, decentralized image and video sharing.',
host : 'default', host : 'default',
@ -36,7 +34,7 @@ function SiteConfig () {
if (!config) { if (!config) {
return console.log('No site config received.'); return console.log('No site config received.');
} }
const { analytics, assetDefaults, auth, customComponents, details, publishing, routes } = config; const { analytics, assetDefaults, auth, customComponents, customContainers, customPages, details, publishing, routes } = config;
console.log('Configuring site details...'); console.log('Configuring site details...');
this.analytics = analytics; this.analytics = analytics;
this.assetDefaults = assetDefaults; this.assetDefaults = assetDefaults;
@ -44,6 +42,8 @@ function SiteConfig () {
this.details = details; this.details = details;
this.publishing = publishing; this.publishing = publishing;
this.customComponents = customComponents; this.customComponents = customComponents;
this.customContainers = customContainers;
this.customPages = customPages;
this.routes = routes; this.routes = routes;
}; };
}; };

4219
index.js

File diff suppressed because one or more lines are too long

View file

@ -12,9 +12,9 @@ module.exports = (helmet, html, preloadedState) => {
${helmet.meta.toString()} ${helmet.meta.toString()}
${helmet.link.toString()} ${helmet.link.toString()}
<!--style sheets--> <!--style sheets-->
<link rel="stylesheet" href="/static/assets/css/reset.css" type="text/css"> <link rel="stylesheet" href="/assets/css/reset.css" type="text/css">
<link rel="stylesheet" href="/static/assets/css/general.css" type="text/css"> <link rel="stylesheet" href="/assets/css/general.css" type="text/css">
<link rel="stylesheet" href="/static/assets/css/mediaQueries.css" type="text/css"> <link rel="stylesheet" href="/assets/css/mediaQueries.css" type="text/css">
<!--google font--> <!--google font-->
<link href="https://fonts.googleapis.com/css?family=Roboto:300" rel="stylesheet"> <link href="https://fonts.googleapis.com/css?family=Roboto:300" rel="stylesheet">
</head> </head>
@ -25,7 +25,7 @@ module.exports = (helmet, html, preloadedState) => {
<script> <script>
window.__PRELOADED_STATE__ = ${JSON.stringify(preloadedState).replace(/</g, '\\\u003c')} window.__PRELOADED_STATE__ = ${JSON.stringify(preloadedState).replace(/</g, '\\\u003c')}
</script> </script>
<script src="/static/bundle/bundle.js"></script> <script src="/bundle/bundle.js"></script>
</body> </body>
</html> </html>
`; `;

View file

@ -50,11 +50,11 @@ function Server () {
if (siteConfig.routes.publicFolder) { if (siteConfig.routes.publicFolder) {
// take in a different public folder, so it can serve it's own bundle if needed // take in a different public folder, so it can serve it's own bundle if needed
const publicFolder = Path.resolve(process.cwd(), siteConfig.routes.publicFolder); const publicFolder = Path.resolve(process.cwd(), siteConfig.routes.publicFolder);
app.use('/static', express.static(publicFolder)); app.use(express.static(publicFolder));
logger.info('serving static files from custom path:', publicFolder); logger.info('serving static files from custom path:', publicFolder);
} else { } else {
const publicPath = Path.resolve(__dirname, 'public'); const publicPath = Path.resolve(__dirname, 'public');
app.use('/static', express.static(publicPath)); app.use(express.static(publicPath));
logger.info('serving static files from default path:', publicPath); logger.info('serving static files from default path:', publicPath);
}; };
// 'body parser' for parsing application/json // 'body parser' for parsing application/json