Add media redirect for RSS feed images

This commit is contained in:
Hippo 2019-10-20 18:02:13 +05:30
parent 4cb47b02ab
commit 0a2c441b5d

View file

@ -1,6 +1,7 @@
const cheerio = require(`cheerio`)
const tagsHelper = require(`@tryghost/helpers`).tags
const _ = require(`lodash`)
const config = require('../siteConfig.js')
const generateItem = function generateItem(post, siteUrl) {
/*
@ -29,7 +30,8 @@ const generateItem = function generateItem(post, siteUrl) {
let imageUrl
if (post.feature_image) {
imageUrl = post.feature_image
// redirect feature image to media directory
imageUrl = post.feature_image.replace(new RegExp(config.mediaUrlFrom, 'g'), config.mediaUrlTo)
// Add a media content tag
item.custom_elements.push({