feat: replace the full text content of utgd with description according to site owner's request

This commit is contained in:
DIYgod 2023-07-25 21:57:18 +01:00
parent e629dc23dc
commit 5e655ebc3b
No known key found for this signature in database
3 changed files with 6 additions and 6 deletions

View File

@ -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),

View File

@ -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),

View File

@ -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),