From 4b84b0dbd7204f125633f60a7805f952e0067d09 Mon Sep 17 00:00:00 2001
From: cxfksword <718792+cxfksword@users.noreply.github.com>
Date: Sat, 11 Mar 2023 22:37:17 +0800
Subject: [PATCH] feat(route): add VCB-Studio (#12074)
* feat(route): add VCB-Studio
* feat(route): VCB-Studio change to use WordPress API
* feat(route): VCB-Studio use art-template
* fix: typo
---------
---
docs/anime.md | 16 +++++++++++
lib/v2/vcb-s/category.js | 51 +++++++++++++++++++++++++++++++++
lib/v2/vcb-s/index.js | 39 +++++++++++++++++++++++++
lib/v2/vcb-s/maintainer.js | 4 +++
lib/v2/vcb-s/radar.js | 19 ++++++++++++
lib/v2/vcb-s/router.js | 4 +++
lib/v2/vcb-s/templates/post.art | 9 ++++++
7 files changed, 142 insertions(+)
create mode 100644 lib/v2/vcb-s/category.js
create mode 100644 lib/v2/vcb-s/index.js
create mode 100644 lib/v2/vcb-s/maintainer.js
create mode 100644 lib/v2/vcb-s/radar.js
create mode 100644 lib/v2/vcb-s/router.js
create mode 100644 lib/v2/vcb-s/templates/post.art
diff --git a/docs/anime.md b/docs/anime.md
index cfac9ad97..19fb30caa 100644
--- a/docs/anime.md
+++ b/docs/anime.md
@@ -436,6 +436,22 @@ Sources
(.*?)<\/pre>/gs, '').replace(/$1(.*?)<\/div>/gs, ' $1'), + medias: item._embedded['wp:featuredmedia'], + }); + + return { + title: item.title.rendered, + link: item.link, + description, + pubDate: parseDate(item.date_gmt), + author: item._embedded.author[0].name, + }; + }); + + ctx.state.data = { + title: 'VCB-Studio - 大家一起实现的故事!', + link: rootUrl, + item: items, + }; +}; diff --git a/lib/v2/vcb-s/maintainer.js b/lib/v2/vcb-s/maintainer.js new file mode 100644 index 000000000..f23ed6384 --- /dev/null +++ b/lib/v2/vcb-s/maintainer.js @@ -0,0 +1,4 @@ +module.exports = { + '/': ['cxfksword'], + '/category/:cate': ['cxfksword'], +}; diff --git a/lib/v2/vcb-s/radar.js b/lib/v2/vcb-s/radar.js new file mode 100644 index 000000000..3f4f80836 --- /dev/null +++ b/lib/v2/vcb-s/radar.js @@ -0,0 +1,19 @@ +module.exports = { + 'vcb-s.com': { + _name: 'VCB-Studio', + '.': [ + { + title: '最新文章', + docs: 'https://docs.rsshub.app/anime.html#vcb-studio', + source: ['/'], + target: '/vcb-s', + }, + { + title: '分类文章', + docs: 'https://docs.rsshub.app/anime.html#vcb-studio', + source: ['/archives/category/:cate'], + target: '/vcb-s/category/:cate', + }, + ], + }, +}; diff --git a/lib/v2/vcb-s/router.js b/lib/v2/vcb-s/router.js new file mode 100644 index 000000000..18fb0db3d --- /dev/null +++ b/lib/v2/vcb-s/router.js @@ -0,0 +1,4 @@ +module.exports = (router) => { + router.get('/', require('./index')); + router.get('/category/:cate', require('./category')); +}; diff --git a/lib/v2/vcb-s/templates/post.art b/lib/v2/vcb-s/templates/post.art new file mode 100644 index 000000000..2f026e84c --- /dev/null +++ b/lib/v2/vcb-s/templates/post.art @@ -0,0 +1,9 @@ + +{{ if medias }} +{{ each medias media }} ++{{ /each }} +{{ /if }} +{{ if post }} +{{@ post }} +{{ /if }}