feat(route)!: remove logseq (#11063)

This commit is contained in:
Tony
2022-10-11 23:50:41 +08:00
committed by GitHub
parent a8d9bf6842
commit 7f355ed2d5
4 changed files with 8 additions and 51 deletions
+4 -3
View File
@@ -286,9 +286,10 @@ Language
## Logseq
### Changelog
<RouteEn author="nczitzk" example="/logseq/changelog" path="/logseq/changelog"/>
::: warning
Logseq dev team has abandoned the [old website](https://logseq.com/blog).
Please use <https://github.com/logseq/logseq/releases.atom> instead.
:::
## MacKed
+4 -3
View File
@@ -318,9 +318,10 @@ pageClass: routes
## Logseq
### Changelog
<Route author="nczitzk" example="/logseq/changelog" path="/logseq/changelog"/>
::: warning
Logseq 开发团队已经放弃了 [旧网站](https://logseq.com/blog)。
请使用 <https://github.com/logseq/logseq/releases.atom> 代替。
:::
## MacKed
-3
View File
@@ -3812,9 +3812,6 @@ router.get('/furaffinity/favorites/:username/:nsfw?', lazyloadRouteHandler('./ro
router.get('/furaffinity/submission_comments/:id', lazyloadRouteHandler('./routes/furaffinity/submission_comments'));
router.get('/furaffinity/journal_comments/:id', lazyloadRouteHandler('./routes/furaffinity/journal_comments'));
// Logseq
router.get('/logseq/changelog', lazyloadRouteHandler('./routes/logseq/changelog'));
// 亿欧网
router.get('/iyiou', lazyloadRouteHandler('./routes/iyiou'));
-42
View File
@@ -1,42 +0,0 @@
const got = require('@/utils/got');
module.exports = async (ctx) => {
const rootUrl = 'https://logseq.com';
const currentUrl = `${rootUrl}/blog/changelog`;
const response = await got({
method: 'get',
url: currentUrl,
});
const data = response.data.split('<p class="footer">')[0];
const list = [],
versionsIndices = [];
const versions = data.match(
/<div class="block"><div id=""><span class="page-reference"><a class="page-ref" href="[a-z]{3}%20\d+[a-z]{2}%2C%20\d{4}">[a-zA-Z]{3} \d+[a-z]{2}, \d{4}<\/a><\/span><\/div><p><b>Version \d\.\d\.\d\.\d/g
);
for (const version of versions) {
versionsIndices.push(data.indexOf(version));
}
for (let i = 0; i < versionsIndices.length; i++) {
list.push(data.slice(versionsIndices[i], versionsIndices[i + 1]));
}
const items = list.map((item, index) => {
const version = versions[index];
return {
link: currentUrl,
description: item,
title: version.match(/Version \d\.\d\.\d\.\d/)[0],
pubDate: new Date(version.match(/[a-zA-Z]{3} \d+[a-z]{2}, \d{4}/)[0].replace(/st|nd|rd|th/, '')).toUTCString(),
};
});
ctx.state.data = {
title: 'Changelog - Logseq',
link: currentUrl,
item: items,
};
};