summaryrefslogtreecommitdiff
path: root/scripts/feed.js
diff options
context:
space:
mode:
author135e2 <[email protected]>2022-06-09 20:55:58 +0800
committer135e2 <[email protected]>2022-06-09 21:01:05 +0800
commite2756367e06ba335ce7ff16f21bc19b510aa513b (patch)
treebc9fe71b89eaa842818bac0524008ce6afc80fd4 /scripts/feed.js
parent8b1c25a6bc56308a274dab10a491bf7ff0dafb87 (diff)
downloadchromate-e2756367e06ba335ce7ff16f21bc19b510aa513b.tar.gz
chromate-e2756367e06ba335ce7ff16f21bc19b510aa513b.tar.bz2
chromate-e2756367e06ba335ce7ff16f21bc19b510aa513b.zip
feat: automatically convert cover path to full_url
Diffstat (limited to 'scripts/feed.js')
-rw-r--r--scripts/feed.js6
1 files changed, 5 insertions, 1 deletions
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,
});
});