0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-27 22:49:56 -05:00

Merge pull request #4901 from felixrieseberg/RSS-Image

Add Post Image to RSS Feed
This commit is contained in:
Hannah Wolfe 2015-02-14 22:35:17 +00:00
commit 13a610a8e1

View file

@ -510,6 +510,11 @@ frontendControllers = {
},
htmlContent = cheerio.load(post.html, {decodeEntities: false});
if (post.image) {
htmlContent('p').first().before('<img src="' + post.image + '" />');
htmlContent('img').attr('alt', post.title);
}
// convert relative resource urls to absolute
['href', 'src'].forEach(function (attributeName) {
htmlContent('[' + attributeName + ']').each(function (ix, el) {