From 62ac95fc702d88cd95394d28d62e6341054844c4 Mon Sep 17 00:00:00 2001 From: Tony Date: Thu, 13 Oct 2022 17:47:10 +0400 Subject: [PATCH] fix(route): science (#11081) * fix(route): science * fix: maintainer rename this can be confirmed by visiting https://github.com/yech1990/myneovim.lua which will be redirected to https://github.com/y9c/myneovim.lua --- docs/en/journal.md | 22 +++++++++++----------- docs/en/study.md | 8 ++++---- docs/journal.md | 24 ++++++++++++------------ docs/study.md | 8 ++++---- lib/routes/cell/cover.js | 2 +- lib/v2/nature/maintainer.js | 10 +++++----- lib/v2/science/current.js | 1 + lib/v2/science/maintainer.js | 6 +++--- lib/v2/science/utils.js | 4 ++-- 9 files changed, 43 insertions(+), 42 deletions(-) diff --git a/docs/en/journal.md b/docs/en/journal.md index f07097bcc..5f78be4be 100644 --- a/docs/en/journal.md +++ b/docs/en/journal.md @@ -77,7 +77,7 @@ Fill in parameter `query` with content after `http://export.arxiv.org/api/query? ### Current Issue - + | `:category` | Query Type | Route | | :---------: | :---------------------: | ---------------------------------------------------------- | @@ -88,7 +88,7 @@ Fill in parameter `query` with content after `http://export.arxiv.org/api/query? ### Cover Story - + Subscribe to the cover images of the Cell journals, and get the latest publication updates in time. @@ -192,7 +192,7 @@ You can get all short name of a journal from ### Latest Research - + | `:journal` | Full Name of the Journal | Route | | :-----------: | :-------------------------: | ---------------------------------------------------------------------------------- | @@ -215,7 +215,7 @@ You can get all short name of a journal from ### News & Comment - + | `:journal` | Full Name of the Journal | Route | | :-----------: | :-------------------------: | --------------------------------------------------------------------------------------------------------------------- | @@ -235,7 +235,7 @@ You can get all short name of a journal from ### Cover Story - + Subscribe to the cover images of the Nature journals, and get the latest publication updates in time. @@ -243,11 +243,11 @@ Subscribe to the cover images of the Nature journals, and get the latest publica ### Nature News - + ### Research Highlight - + ::: warning Warning @@ -288,7 +288,7 @@ Only some journals are supported. ### Trending articles - + ::: tip Tip @@ -304,7 +304,7 @@ In + | Short name | Full name of the journal | Route | | :--------: | :----------------------------: | ---------------------------------------------------------------------------------- | @@ -322,7 +322,7 @@ In + Subscribe to the cover images of Science journals, and get the latest publication updates in time. @@ -332,7 +332,7 @@ Including 'Science', 'Science Advances', 'Science Immunology', 'Science Robotics ### First Release - + *only Science, Science Immunology and Science Translational Medicine have first release* diff --git a/docs/en/study.md b/docs/en/study.md index 32064d36d..82b05fd62 100644 --- a/docs/en/study.md +++ b/docs/en/study.md @@ -39,7 +39,7 @@ pageClass: routes ### Theses - + | `:param` | example | definition | | -------- | --------------- | -------------------------------------- | @@ -116,7 +116,7 @@ pageClass: routes ### News - + | `:type` | type name | | --------- | --------- | @@ -134,11 +134,11 @@ pageClass: routes ### depth - + ### innovation - + | `:type` | type name | | ------------- | ------------- | diff --git a/docs/journal.md b/docs/journal.md index 4acf91d5b..d306716dc 100644 --- a/docs/journal.md +++ b/docs/journal.md @@ -77,7 +77,7 @@ pageClass: routes ### 主刊 - + | `:category` | 类型说明 | 路由 | | :---------: | :---------: | ---------------------------------------------------------- | @@ -88,7 +88,7 @@ pageClass: routes ### 封面故事 - + 订阅 Cell 系列杂志的封面图片,并及时获取刊物更新状态。 @@ -164,7 +164,7 @@ You can get all short name of a journal from ### 最新成果 - + | `:journal` | 期刊名 | 路由 | | :-----------: | :-------------------------: | ---------------------------------------------------------------------------------- | @@ -187,7 +187,7 @@ You can get all short name of a journal from ### 新闻及评论 - + | `:journal` | 期刊名 | 路由 | | :-----------: | :-------------------------: | -------------------------------------------------------------------------------------------------- | @@ -208,7 +208,7 @@ You can get all short name of a journal from ### 封面故事 - + 订阅 Nature 系列杂志的封面图片,并及时获取刊物更新状态。 @@ -216,11 +216,11 @@ You can get all short name of a journal from ### 主刊 - 新闻动态 - + ### 精彩研究 - + ::: warning 警告 @@ -244,7 +244,7 @@ You can get all short name of a journal from ### 最新文章(可筛选领域) - + - 通过 `/pnas/` + “领域名称” 来获取对应 “领域” 的最新文章(Latest Research)。 若参数置空(`/pnas`)或为 latest(`/pnas/latest`),则默认获取全部文章。 @@ -255,7 +255,7 @@ You can get all short name of a journal from ### Trending articles - + ::: tip 提示 @@ -271,7 +271,7 @@ You can get all short name of a journal from ### 本期刊物 - + | 简写 | 期刊名 | 路由 | | :---------: | :----------------------------: | ------------------------------------------------------------------------------ | @@ -289,7 +289,7 @@ You can get all short name of a journal from ### 封面故事 - + 订阅 Science 系列杂志的封面图片,并及时获取刊物更新状态。 @@ -299,7 +299,7 @@ You can get all short name of a journal from ### 在线发表 - + *仅 Science, Science Immunology 和 Science Translational Medicine 提供在线发表* diff --git a/docs/study.md b/docs/study.md index 421a24b59..4c565f9c8 100644 --- a/docs/study.md +++ b/docs/study.md @@ -329,7 +329,7 @@ path="/ctfhub/upcoming/:limit?" ### 论文 - + | `:param` | 举例 | 定义 | | -------- | --------------- | --------------------------------- | @@ -580,7 +580,7 @@ path="/ctfhub/upcoming/:limit?" ### 新聞 - + | `:type` | 类别名称 | | --------- | ---- | @@ -596,11 +596,11 @@ path="/ctfhub/upcoming/:limit?" ### 深度 - + ### 创新 - + | `:type` | 类别名称 | | ------------- | ------ | diff --git a/lib/routes/cell/cover.js b/lib/routes/cell/cover.js index 3280e7518..bf7958efc 100644 --- a/lib/routes/cell/cover.js +++ b/lib/routes/cell/cover.js @@ -87,7 +87,7 @@ module.exports = async (ctx) => { const single = { title: `${pageMeta.issueName} | ${pageMeta.issueNum} (${pageMeta.issueDate})`, - author: '@yech1990', + author: '@y9c', description: contents, link: address, guid: address, diff --git a/lib/v2/nature/maintainer.js b/lib/v2/nature/maintainer.js index cd003d9d0..52f1f3787 100644 --- a/lib/v2/nature/maintainer.js +++ b/lib/v2/nature/maintainer.js @@ -1,8 +1,8 @@ module.exports = { - '/cover': ['yech1990'], - '/highlight/:journal?/:year?': ['yech1990', 'TonyRL'], - '/news': ['yech1990', 'TonyRL'], - '/news-and-comment/:journal?': ['yech1990', 'TonyRL'], - '/research/:journal?': ['yech1990', 'TonyRL'], + '/cover': ['y9c'], + '/highlight/:journal?/:year?': ['y9c', 'TonyRL'], + '/news': ['y9c', 'TonyRL'], + '/news-and-comment/:journal?': ['y9c', 'TonyRL'], + '/research/:journal?': ['y9c', 'TonyRL'], '/siteindex': ['TonyRL'], }; diff --git a/lib/v2/science/current.js b/lib/v2/science/current.js index 57956f2f1..4cd039f36 100644 --- a/lib/v2/science/current.js +++ b/lib/v2/science/current.js @@ -36,6 +36,7 @@ module.exports = async (ctx) => { description: `Current Issue of ${pageTitleName}`, image: `${baseUrl}/apple-touch-icon.png`, link: pageURL, + language: 'en-US', item: items, }; }; diff --git a/lib/v2/science/maintainer.js b/lib/v2/science/maintainer.js index 7f0a84a6c..3a4700144 100644 --- a/lib/v2/science/maintainer.js +++ b/lib/v2/science/maintainer.js @@ -1,5 +1,5 @@ module.exports = { - '/cover': ['yech1990', 'TonyRL'], - '/current/:journal?': ['yech1990', 'TonyRL'], - '/early/:journal?': ['yech1990', 'TonyRL'], + '/cover': ['y9c', 'TonyRL'], + '/current/:journal?': ['y9c', 'TonyRL'], + '/early/:journal?': ['y9c', 'TonyRL'], }; diff --git a/lib/v2/science/utils.js b/lib/v2/science/utils.js index 94901be10..27eb2418c 100644 --- a/lib/v2/science/utils.js +++ b/lib/v2/science/utils.js @@ -18,7 +18,7 @@ const fetchDesc = (list, browser, tryGet) => await page.goto(item.link, { waitUntil: 'domcontentloaded', }); - await page.waitForSelector('section#frontmatter, .news-article-content, .news-article-content--featured'); + await page.waitForSelector('section#bodymatter, .news-article-content, .news-article-content--featured'); const res = await page.evaluate(() => document.documentElement.innerHTML); await page.close(); @@ -28,7 +28,7 @@ const fetchDesc = (list, browser, tryGet) => ? $('.news-article-content--featured').html() : $('.news-article-content').length ? $('.news-article-content').html() - : $('.info-panel__formats a.btn__request-access').length + : $('.info-panel__formats a.btn__request-access').length || $('.info-panel__formats a.btn--access').length ? '' : $('section#bodymatter').html();