diff --git a/lib/v2/wallstreetcn/live.js b/lib/v2/wallstreetcn/live.js index 7e584ddd1..ee32c0c7a 100644 --- a/lib/v2/wallstreetcn/live.js +++ b/lib/v2/wallstreetcn/live.js @@ -1,5 +1,7 @@ const got = require('@/utils/got'); const { parseDate } = require('@/utils/parse-date'); +const { art } = require('@/utils/render'); +const path = require('path'); const titles = { global: '要闻', @@ -30,9 +32,13 @@ module.exports = async (ctx) => { .map((item) => ({ link: item.uri, title: item.title || item.content_text, - description: item.content + (item.content_more ?? ''), pubDate: parseDate(item.display_time * 1000), author: item.author?.display_name ?? '', + description: art(path.join(__dirname, 'templates/description.art'), { + description: item.content, + more: item.content_more, + images: item.images, + }), })); ctx.state.data = { diff --git a/lib/v2/wallstreetcn/templates/description.art b/lib/v2/wallstreetcn/templates/description.art new file mode 100644 index 000000000..ee1f9e6f2 --- /dev/null +++ b/lib/v2/wallstreetcn/templates/description.art @@ -0,0 +1,11 @@ +{{ if description }} +{{@ description }} +{{ /if }} +{{ if more }} +{{@ more }} +{{ /if }} +{{ if images }} +{{ each images image }} + +{{ /each }} +{{ /if }} \ No newline at end of file