Skip to content

Node.js based forum software built for the modern web

move hardcoded initial welcome text into welcome.md

psychobunnyf4c587c530fd
diff --git a/install/data/welcome.md b/install/data/welcome.md
new file mode 100644
index 0000000000..399850e6e2
--- /dev/null
+++ b/install/data/welcome.md
@@ -0,0 +1,10 @@
+# Welcome to your brand new NodeBB forum!
+
+This is what a topic and post looks like. As an administator, you can edit the post\'s title and content.
+To customise your forum, go to the [Administrator Control Panel](../../admin). You can modify all aspects of your forum there, including installation of third-party plugins.
+
+## Additional Resources
+
+* [NodeBB Documentation](https://docs.nodebb.org)
+* [Community Support Forum](https://community.nodebb.org)
+* [Project repository](https://github.com/nodebb/nodebb)
\ No newline at end of file
diff --git a/src/install.js b/src/install.js
index 54fb075ced..61f4bc56c0 100644
--- a/src/install.js
+++ b/src/install.js
@@ -389,13 +389,23 @@ function createWelcomePost(next) {
var db = require('./database'),
Topics = require('./topics');
- db.sortedSetCard('topics:tid', function(err, numTopics) {
+ async.parallel([
+ function(next) {
+ fs.readFile(path.join(__dirname, '../', 'install/data/welcome.md'), next);
+ },
+ function(next) {
+ db.sortedSetCard('topics:tid', next);
+ }
+ ], function(err, results) {
+ var content = results[0],
+ numTopics = results[1];
+
if (numTopics === 0) {
Topics.post({
uid: 1,
cid: 2,
title: 'Welcome to your NodeBB!',
- content: '# Welcome to your brand new NodeBB forum!\n\nThis is what a topic and post looks like. As an administator, you can edit the post\'s title and content.\n\nTo customise your forum, go to the [Administrator Control Panel](../../admin). You can modify all aspects of your forum there, including installation of third-party plugins.\n\n## Additional Resources\n\n* [NodeBB Documentation](https://docs.nodebb.org)\n* [Community Support Forum](https://community.nodebb.org)\n* [Project repository](https://github.com/nodebb/nodebb)'
+ content: content.toString()
}, next);
} else {
next();