updated siteConfig to separate custom containers, components, and pages
This commit is contained in:
parent
2c48d22add
commit
ba01ce8e68
4 changed files with 4229 additions and 14 deletions
|
@ -10,11 +10,9 @@ function SiteConfig () {
|
|||
this.auth = {
|
||||
sessionKey: 'default',
|
||||
};
|
||||
this.customComponents = {
|
||||
components: {},
|
||||
containers: {},
|
||||
pages : {},
|
||||
};
|
||||
this.customComponents = {};
|
||||
this.customContainers = {};
|
||||
this.customPages = {};
|
||||
this.details = {
|
||||
description: 'Open-source, decentralized image and video sharing.',
|
||||
host : 'default',
|
||||
|
@ -36,7 +34,7 @@ function SiteConfig () {
|
|||
if (!config) {
|
||||
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...');
|
||||
this.analytics = analytics;
|
||||
this.assetDefaults = assetDefaults;
|
||||
|
@ -44,6 +42,8 @@ function SiteConfig () {
|
|||
this.details = details;
|
||||
this.publishing = publishing;
|
||||
this.customComponents = customComponents;
|
||||
this.customContainers = customContainers;
|
||||
this.customPages = customPages;
|
||||
this.routes = routes;
|
||||
};
|
||||
};
|
||||
|
|
4219
index.js
4219
index.js
File diff suppressed because one or more lines are too long
|
@ -12,9 +12,9 @@ module.exports = (helmet, html, preloadedState) => {
|
|||
${helmet.meta.toString()}
|
||||
${helmet.link.toString()}
|
||||
<!--style sheets-->
|
||||
<link rel="stylesheet" href="/static/assets/css/reset.css" type="text/css">
|
||||
<link rel="stylesheet" href="/static/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/reset.css" type="text/css">
|
||||
<link rel="stylesheet" href="/assets/css/general.css" type="text/css">
|
||||
<link rel="stylesheet" href="/assets/css/mediaQueries.css" type="text/css">
|
||||
<!--google font-->
|
||||
<link href="https://fonts.googleapis.com/css?family=Roboto:300" rel="stylesheet">
|
||||
</head>
|
||||
|
@ -25,7 +25,7 @@ module.exports = (helmet, html, preloadedState) => {
|
|||
<script>
|
||||
window.__PRELOADED_STATE__ = ${JSON.stringify(preloadedState).replace(/</g, '\\\u003c')}
|
||||
</script>
|
||||
<script src="/static/bundle/bundle.js"></script>
|
||||
<script src="/bundle/bundle.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
`;
|
||||
|
|
|
@ -50,11 +50,11 @@ function Server () {
|
|||
if (siteConfig.routes.publicFolder) {
|
||||
// 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);
|
||||
app.use('/static', express.static(publicFolder));
|
||||
app.use(express.static(publicFolder));
|
||||
logger.info('serving static files from custom path:', publicFolder);
|
||||
} else {
|
||||
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);
|
||||
};
|
||||
// 'body parser' for parsing application/json
|
||||
|
|
Loading…
Add table
Reference in a new issue