From 5e655ebc3bfc3b0c63c9078f56f0f660f2af6dcc Mon Sep 17 00:00:00 2001 From: DIYgod Date: Tue, 25 Jul 2023 21:57:18 +0100 Subject: [PATCH] feat: replace the full text content of utgd with description according to site owner's request --- lib/v2/utgd/category.js | 4 ++-- lib/v2/utgd/timeline.js | 4 ++-- lib/v2/utgd/topic.js | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/v2/utgd/category.js b/lib/v2/utgd/category.js index cdb272cef..101d052b8 100644 --- a/lib/v2/utgd/category.js +++ b/lib/v2/utgd/category.js @@ -28,7 +28,7 @@ module.exports = async (ctx) => { url: apiUrl, searchParams: { type: 'article.Article', - fields: `article_category(category_name),article_tag(tag_name),title,article_image,article_author,article_content,article_published_time`, + fields: `article_category(category_name),article_tag(tag_name),title,article_image,article_author,article_description,article_published_time`, article_category: data.id, order: '-article_published_time', limit, @@ -48,7 +48,7 @@ module.exports = async (ctx) => { link: `${rootUrl}/article/${item.id}`, description: art(path.join(__dirname, 'templates/description.art'), { image: item.article_image, - description: md.render(item.article_content), + description: md.render(item.article_description), }), author: authorResponse.data.display_name, pubDate: timezone(parseDate(item.article_published_time), +8), diff --git a/lib/v2/utgd/timeline.js b/lib/v2/utgd/timeline.js index 21587f1a1..343a0e266 100644 --- a/lib/v2/utgd/timeline.js +++ b/lib/v2/utgd/timeline.js @@ -25,7 +25,7 @@ module.exports = async (ctx) => { method: 'get', url: `${rootUrl}/api/v2/pages/${item.id}/`, searchParams: { - fields: 'article_content,article_category(category_name),article_tag(tag_name)', + fields: 'article_description,article_category(category_name),article_tag(tag_name)', }, }); @@ -36,7 +36,7 @@ module.exports = async (ctx) => { link: `${rootUrl}/article/${item.id}`, description: art(path.join(__dirname, 'templates/description.art'), { image: item.article_image, - description: md.render(data.article_content), + description: md.render(data.article_description), }), author: item.article_author_displayname, pubDate: timezone(parseDate(item.article_published_time), +8), diff --git a/lib/v2/utgd/topic.js b/lib/v2/utgd/topic.js index 4d6c4e970..62b57bead 100644 --- a/lib/v2/utgd/topic.js +++ b/lib/v2/utgd/topic.js @@ -42,7 +42,7 @@ module.exports = async (ctx) => { method: 'get', url: `${rootUrl}/api/v2/pages/${item.id}/`, searchParams: { - fields: 'article_content', + fields: 'article_description', }, }); @@ -51,7 +51,7 @@ module.exports = async (ctx) => { link: `${rootUrl}/article/${item.id}`, description: art(path.join(__dirname, 'templates/description.art'), { image: item.article_image, - description: md.render(detailResponse.data.article_content), + description: md.render(detailResponse.data.article_description), }), author: item.article_author_displayname, pubDate: timezone(parseDate(item.article_published_time), +8),