From 3be5ec527090541453cde1eee8aab9290af59a30 Mon Sep 17 00:00:00 2001 From: SunBK201 Date: Sat, 31 Dec 2022 21:27:48 +0800 Subject: [PATCH] feat: add release game tags (#11520) --- lib/v2/ymgal/game.js | 4 +++- lib/v2/ymgal/templates/description.art | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/v2/ymgal/game.js b/lib/v2/ymgal/game.js index 809513bf0..d3d749459 100644 --- a/lib/v2/ymgal/game.js +++ b/lib/v2/ymgal/game.js @@ -23,10 +23,12 @@ module.exports = async (ctx) => { list.map((item) => { item = $(item); const itemPicUrl = item.find('.lazy').first().attr('data-original'); + const tags = item.find('.tag-info-list').children(); + const taginfo = tags.map((i, elem) => $(elem).text()).get(); return { title: item.attr('title'), link: `${host}${item.attr('href')}`, - description: art(path.join(__dirname, 'templates/description.art'), { itemPicUrl }), + description: art(path.join(__dirname, 'templates/description.art'), { itemPicUrl, taginfo }), }; }); diff --git a/lib/v2/ymgal/templates/description.art b/lib/v2/ymgal/templates/description.art index 2ab9cf91b..fabf8506a 100644 --- a/lib/v2/ymgal/templates/description.art +++ b/lib/v2/ymgal/templates/description.art @@ -1,3 +1,7 @@ {{ if itemPicUrl }} -{{ /if }} \ No newline at end of file +{{ /if }} +
+{{each taginfo}} +
  • {{$value}}
  • +{{/each}} \ No newline at end of file