diff options
| author | 135e2 <135e2@135e2.tk> | 2022-06-09 20:55:58 +0800 | 
|---|---|---|
| committer | 135e2 <135e2@135e2.tk> | 2022-06-09 21:01:05 +0800 | 
| commit | e2756367e06ba335ce7ff16f21bc19b510aa513b (patch) | |
| tree | bc9fe71b89eaa842818bac0524008ce6afc80fd4 | |
| parent | 8b1c25a6bc56308a274dab10a491bf7ff0dafb87 (diff) | |
| download | chromate-e2756367e06ba335ce7ff16f21bc19b510aa513b.tar.gz chromate-e2756367e06ba335ce7ff16f21bc19b510aa513b.tar.bz2 chromate-e2756367e06ba335ce7ff16f21bc19b510aa513b.zip | |
feat: automatically convert cover path to full_url
| -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,          });      }); | 
