From a682c401554a4013b3fe788f08e8fe0fac391d6d Mon Sep 17 00:00:00 2001 From: 135e2 <135e2@135e2.tk> Date: Thu, 9 Jun 2022 20:55:58 +0800 Subject: feat: automatically convert cover path to full_url --- scripts/feed.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/feed.js b/scripts/feed.js index 3265ec2..5196de1 100644 --- a/scripts/feed.js +++ b/scripts/feed.js @@ -66,6 +66,10 @@ hexo.extend.generator.register("feed", (locals) => { let url = post.podcast.media.url; if (!(url.startsWith("http://") || url.startsWith("https://"))) url = fullurl(post.path, { relative: false }).replace("index.html", '') + url; + // Check local cover url + let cover = post.podcast.cover; + if (!(cover.startsWith("http://") || cover.startsWith("https://"))) + cover = fullurl(post.path, { relative: false }).replace("index.html", '') + cover; feed.addItem({ title: post.title, @@ -84,7 +88,7 @@ hexo.extend.generator.register("feed", (locals) => { itunesSummary: hstrip(post.excerpt), itunesSubtitle: post.podcast.subtitle, itunesDuration: post.podcast.duration, - itunesImage: post.podcast.cover, + itunesImage: cover, }); }); -- cgit v1.2.3