feat: add release game tags (#11520)

This commit is contained in:
SunBK201 2022-12-31 21:27:48 +08:00 committed by GitHub
parent 311c289082
commit 3be5ec5270
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View File

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

View File

@ -1,3 +1,7 @@
{{ if itemPicUrl }}
<img src="{{ itemPicUrl }}">
{{ /if }}
{{ /if }}
<br>
{{each taginfo}}
<li>{{$value}}</li>
{{/each}}