mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-30 21:40:39 +03:00
Add Post Image to RSS Feed
Closes #4888 - If a post cover image exists, it is added to the `description` tag (at the very front). This allows RSS readers to pic up the picture.
This commit is contained in:
parent
a110b3741f
commit
762a47b6bf
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user