This commit is contained in:
Julian Lam
2013-11-22 11:42:42 -05:00
parent a7216caa3b
commit 08ef67e824
9 changed files with 124 additions and 46 deletions

View File

@@ -318,7 +318,7 @@ var path = require('path'),
});
});
translator.translate(templates.logout.toString(), function(parsedTemplate) {
templates.logout = parsedTemplate;
});
@@ -649,6 +649,32 @@ var path = require('path'),
"Sitemap: " + nconf.get('url') + "sitemap.xml");
});
app.get('/recent.rss', function(req, res) {
var rssPath = path.join(__dirname, '../', 'feeds/recent.rss'),
loadFeed = function () {
fs.readFile(rssPath, function (err, data) {
if (err) {
res.type('text').send(404, "Unable to locate an rss feed at this location.");
} else {
res.type('xml').set('Content-Length', data.length).send(data);
}
});
};
if (!fs.existsSync(rssPath)) {
feed.updaterecent(function (err) {
if (err) {
res.redirect('/404');
} else {
loadFeed();
}
});
} else {
loadFeed();
}
});
app.get('/recent/:term?', function (req, res) {
// TODO consolidate with /recent route as well -> that can be combined into this area. See "Basic Routes" near top.
app.build_header({