|
|
@@ -11,6 +11,18 @@ module.exports = function(crowi, app) {
|
|
|
|
|
|
, actions = {};
|
|
|
|
|
|
+ function createInitialPages(owner, lang) {
|
|
|
+ // create portal page for '/'
|
|
|
+ const welcomeMarkdownPath = path.join(crowi.localeDir, lang, 'welcome.md');
|
|
|
+ const welcomeMarkdown = fs.readFileSync(welcomeMarkdownPath);
|
|
|
+ Page.create('/', welcomeMarkdown, owner, {});
|
|
|
+
|
|
|
+ // create /Sandbox
|
|
|
+ const sandboxMarkdownPath = path.join(crowi.localeDir, lang, 'sandbox.md');
|
|
|
+ const sandboxMarkdown = fs.readFileSync(sandboxMarkdownPath);
|
|
|
+ Page.create('/Sandbox', sandboxMarkdown, owner, {});
|
|
|
+ }
|
|
|
+
|
|
|
actions.index = function(req, res) {
|
|
|
return res.render('installer');
|
|
|
};
|
|
|
@@ -49,10 +61,8 @@ module.exports = function(crowi, app) {
|
|
|
});
|
|
|
});
|
|
|
|
|
|
- // create portal page for '/'
|
|
|
- const welcomeMarkdownPath = path.join(crowi.localeDir, language, 'welcome.md');
|
|
|
- const welcomeMarkdown = fs.readFileSync(welcomeMarkdownPath);
|
|
|
- Page.create('/', welcomeMarkdown, userData, {});
|
|
|
+ // create initial pages
|
|
|
+ createInitialPages(userData, language);
|
|
|
});
|
|
|
});
|
|
|
} else {
|