diff options
author | 135e2 <[email protected]> | 2022-06-03 11:22:01 +0800 |
---|---|---|
committer | 135e2 <[email protected]> | 2022-06-03 11:31:51 +0800 |
commit | 68d0822b2997364a02f847cffb6eaef12377081f (patch) | |
tree | 9d4b6201fc4931b6af45d27d13396df9dbf25c6c | |
parent | 15ff5d72e521203b54995698408616b2a4bb1c30 (diff) | |
download | chromate-68d0822b2997364a02f847cffb6eaef12377081f.tar.gz chromate-68d0822b2997364a02f847cffb6eaef12377081f.tar.bz2 chromate-68d0822b2997364a02f847cffb6eaef12377081f.zip |
feat: automatically convert logo path to full_url
-rw-r--r-- | scripts/feed.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/scripts/feed.js b/scripts/feed.js index 3c567f3..3265ec2 100644 --- a/scripts/feed.js +++ b/scripts/feed.js @@ -31,6 +31,9 @@ hexo.extend.generator.register("feed", (locals) => { categories.push(category); }); + let logo = theme.logo.rss; + if (!(logo.startsWith("http://") || logo.startsWith("https://"))) + logo = fullurl(logo, { relative: false });; // Render for site config const feed = new podcast({ title: config.title, @@ -38,7 +41,7 @@ hexo.extend.generator.register("feed", (locals) => { copyright: config.title + ' ' + theme.copyright, language: config.language.slice(0, 2), siteUrl: config.url, - imageUrl: theme.logo.rss, + imageUrl: logo, itunesSubtitle: config.subtitle, itunesSummary: config.description, itunesAuthor: config.author, @@ -62,7 +65,7 @@ hexo.extend.generator.register("feed", (locals) => { // Check local media url let url = post.podcast.media.url; if (!(url.startsWith("http://") || url.startsWith("https://"))) - url = fullurl(post.path, {relative: false}).replace("index.html", '') + url; + url = fullurl(post.path, { relative: false }).replace("index.html", '') + url; feed.addItem({ title: post.title, |