diff --git a/src/routes/api.js b/src/routes/api.js index f77771ff97..9502a96f08 100644 --- a/src/routes/api.js +++ b/src/routes/api.js @@ -68,39 +68,44 @@ var path = require('path'), async.each(data.categories, iterator, function (err) { // Assemble the MOTD - var motdString; + var motdString, + assemble = function() { + data.motd_class = (parseInt(meta.config.show_motd, 10) === 1 || meta.config.show_motd === undefined) ? '' : ' none'; + data.motd_class += (meta.config.motd && meta.config.motd.length > 0 ? '' : ' default'); + data.motd_class += meta.config.motd_class ? ' ' + meta.config.motd_class : ''; + + data.motd = require('marked')(motdString); + res.json(data); + }; if (!meta.config.motd) { // Construct default MOTD - translator.mget(['global:motd.welcome', 'global:motd.get', 'global:motd.fork', 'global:motd.like', 'global:motd.follow'], function(err, strings) { - motdString = '\n\n# NodeBB \nv' + pkg.version + '\n\n' + strings[0] + - '