Add media redirect for RSS feed images
This commit is contained in:
parent
4cb47b02ab
commit
0a2c441b5d
1 changed files with 3 additions and 1 deletions
|
@ -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({
|
||||
|
|
Loading…
Reference in a new issue