feat: 支持 Sakurazaka46 Blog 分页订阅 (#12683)

* feat: 支持分页订阅

* chore: lint ignore

* docs: complete document

* docs: single line component

---------
This commit is contained in:
Akashi
2023-06-20 22:34:40 +08:00
committed by GitHub
parent 3c6be9309b
commit f8cf1d6e55
5 changed files with 8 additions and 6 deletions
+1 -1
View File
@@ -645,7 +645,7 @@ Compared to the official one, this feed:
### Sakurazaka46 Blog
<RouteEn author="victor21813 nczitzk" example="/sakurazaka46/blog" path="/sakurazaka46/blog/:id?" :paramsDesc="['Member ID, see below, all by default']">
<RouteEn author="victor21813 nczitzk akashigakki" example="/sakurazaka46/blog" path="/sakurazaka46/blog/:id?/:page?" :paramsDesc="['Member ID, see below, `all` by default', 'Page, `0` by default']">
| Member ID | Name |
| -- | ------ |
+1 -1
View File
@@ -1737,7 +1737,7 @@ Supported sub-sites:
### 櫻坂 46 博客
<Route author="victor21813 nczitzk" example="/sakurazaka46/blog" path="/sakurazaka46/blog/:id?" :paramsDesc="['成员编号,见下表,默认为全部']">
<Route author="victor21813 nczitzk akashigakki" example="/sakurazaka46/blog" path="/sakurazaka46/blog/:id?/:page?" :paramsDesc="['成员编号,见下表,默认为`all` (全部)', '订阅页码,默认为`0` (第一页)']">
| 编号 | 姓名 |
| ---- | ----------- |
+4 -2
View File
@@ -4,10 +4,12 @@ const timezone = require('@/utils/timezone');
const { parseDate } = require('@/utils/parse-date');
module.exports = async (ctx) => {
const id = ctx.params.id ?? '';
const id = ctx.params.id ?? 'all';
const page = ctx.params.page ?? '0';
const rootUrl = 'https://sakurazaka46.com';
const currentUrl = `${rootUrl}/s/s46/diary/blog/list${id ? `?ct=${id}` : ''}`;
const params = id === 'all' ? `?page=${page}` : `?page=${page}&ct=${id}`;
const currentUrl = `${rootUrl}/s/s46/diary/blog/list${params}`;
const response = await got({
method: 'get',
+1 -1
View File
@@ -1,4 +1,4 @@
module.exports = {
'/blog/:id?': ['victor21813', 'nczitzk'],
'/blog/:id?/:page?': ['victor21813', 'nczitzk', 'akashigakki'],
'/news': ['nczitzk'],
};
+1 -1
View File
@@ -1,4 +1,4 @@
module.exports = function (router) {
router.get('/blog/:id?', require('./blog'));
router.get('/blog/:id?/:page?', require('./blog'));
router.get('/news', require('./news'));
};