summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
author135e2 <[email protected]>2022-06-03 11:22:01 +0800
committer135e2 <[email protected]>2022-06-03 11:22:01 +0800
commitdd55b63d3f0e597612627d5488af0817ced7c540 (patch)
treedb58f46886c0944daafd58e3562f3c2195fde9f1 /scripts
parent359c96d8ba825d489d2bff1e3e99741ae129cd56 (diff)
downloadchromate-dd55b63d3f0e597612627d5488af0817ced7c540.tar.gz
chromate-dd55b63d3f0e597612627d5488af0817ced7c540.tar.bz2
chromate-dd55b63d3f0e597612627d5488af0817ced7c540.zip
feat: automatically convert logo path to full_url
Diffstat (limited to 'scripts')
-rw-r--r--scripts/feed.js7
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,