mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-11 00:15:46 +01:00
move hardcoded initial welcome text into welcome.md
This commit is contained in:
10
install/data/welcome.md
Normal file
10
install/data/welcome.md
Normal file
@@ -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)
|
||||||
@@ -389,13 +389,23 @@ function createWelcomePost(next) {
|
|||||||
var db = require('./database'),
|
var db = require('./database'),
|
||||||
Topics = require('./topics');
|
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) {
|
if (numTopics === 0) {
|
||||||
Topics.post({
|
Topics.post({
|
||||||
uid: 1,
|
uid: 1,
|
||||||
cid: 2,
|
cid: 2,
|
||||||
title: 'Welcome to your NodeBB!',
|
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);
|
}, next);
|
||||||
} else {
|
} else {
|
||||||
next();
|
next();
|
||||||
|
|||||||
Reference in New Issue
Block a user