summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--_config.yml5
-rw-r--r--scripts/feed.js20
2 files changed, 23 insertions, 2 deletions
diff --git a/_config.yml b/_config.yml
index 3d16dc3..78c6e3a 100644
--- a/_config.yml
+++ b/_config.yml
@@ -23,5 +23,8 @@ rss:
path: '/feed.rss'
config:
- category: 'Education'
+ category: {
+ 'Education': ['How To', 'Language Learning'],
+ 'Technology': []
+ }
explicit: false \ No newline at end of file
diff --git a/scripts/feed.js b/scripts/feed.js
index 7c394bd..c64dcb7 100644
--- a/scripts/feed.js
+++ b/scripts/feed.js
@@ -11,6 +11,24 @@ hexo.extend.generator.register("feed", (locals) => {
const podcast = require("podcast");
+ // Generate Podcast Categories content
+ let categories = [];
+ Object.keys(theme.rss.config.category).forEach((key) => {
+ const category = {
+ text: key,
+ subcats: []
+ };
+ const subcats = theme.rss.config.category[key];
+ subcats.forEach((subcat) => {
+ category.subcats.push({
+ text: subcat
+ });
+ });
+ categories.push(category);
+ });
+
+ console.log(categories);
+
// Render for site config
const feed = new podcast({
title: config.title,
@@ -23,7 +41,7 @@ hexo.extend.generator.register("feed", (locals) => {
itunesSummary: config.description,
itunesAuthor: config.author,
itunesExplicit: theme.rss.config.explicit,
- itunesCategory: theme.rss.config.category,
+ itunesCategory: categories,
itunesOwner: {
name: config.author,
email: theme.rss.config.email