diff --git a/core/server/controllers/frontend.js b/core/server/controllers/frontend.js
index 83f3501ba6..44f8cfc82e 100644
--- a/core/server/controllers/frontend.js
+++ b/core/server/controllers/frontend.js
@@ -15,6 +15,7 @@ var moment = require('moment'),
template = require('../helpers/template'),
errors = require('../errors'),
cheerio = require('cheerio'),
+ downsize = require('downsize'),
routeMatch = require('path-match')(),
frontendControllers,
@@ -500,7 +501,10 @@ frontendControllers = {
generator: 'Ghost ' + trimmedVersion,
feed_url: feedUrl,
site_url: siteUrl,
- ttl: '60'
+ ttl: '60',
+ custom_namespaces: {
+ content: 'http://purl.org/rss/1.0/modules/content/'
+ }
});
// If page is greater than number of pages we have, redirect to last page
@@ -566,11 +570,18 @@ frontendControllers = {
});
});
- item.description = htmlContent.html();
+ item.custom_elements = [{
+ 'content:encoded': {
+ _cdata: htmlContent.html()
+ }
+ }];
+
+ item.description = post.meta_description || downsize(htmlContent.html(), {words: 50});
+
feed.item(item);
});
}).then(function () {
- res.set('Content-Type', 'application/rss+xml; charset=UTF-8');
+ res.set('Content-Type', 'text/xml; charset=UTF-8');
res.send(feed.xml());
});
});
diff --git a/core/test/functional/routes/frontend_test.js b/core/test/functional/routes/frontend_test.js
index 5f91509018..dedd9aedb2 100644
--- a/core/test/functional/routes/frontend_test.js
+++ b/core/test/functional/routes/frontend_test.js
@@ -376,7 +376,7 @@ describe('Frontend Routing', function () {
it('should respond with xml', function (done) {
request.get('/rss/')
- .expect('Content-Type', 'application/rss+xml; charset=utf-8')
+ .expect('Content-Type', 'text/xml; charset=utf-8')
.expect('Cache-Control', testUtils.cacheRules['public'])
.expect(200)
.end(function (err, res) {
@@ -394,8 +394,9 @@ describe('Frontend Routing', function () {
siteDescription = '
mctesters
\n\n