diff options
author | 135e2 <[email protected]> | 2022-06-09 20:55:58 +0800 |
---|---|---|
committer | 135e2 <[email protected]> | 2022-06-09 21:01:37 +0800 |
commit | a682c401554a4013b3fe788f08e8fe0fac391d6d (patch) | |
tree | 4dc735c27e06d04240ad5cdc4bfb7a12919de58d /scripts | |
parent | dd55b63d3f0e597612627d5488af0817ced7c540 (diff) | |
download | chromate-a682c401554a4013b3fe788f08e8fe0fac391d6d.tar.gz chromate-a682c401554a4013b3fe788f08e8fe0fac391d6d.tar.bz2 chromate-a682c401554a4013b3fe788f08e8fe0fac391d6d.zip |
feat: automatically convert cover path to full_urldev
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/feed.js | 6 |
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, }); }); |