fix(route): 18comic add cover image (#14858)

This commit is contained in:
Mg Pig 2024-03-19 23:38:30 +08:00 committed by GitHub
parent 0f4672570f
commit 9399fb3266
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 0 deletions

View File

@ -1,3 +1,6 @@
{{ if cover }}
<img src="{{ cover }}">
{{ /if }}
<p>{{ introduction }}</p>
{{ each images image }}
<img src="{{ image }}">

View File

@ -49,6 +49,7 @@ const ProcessItems = async (ctx, currentUrl, rootUrl) => {
const content = load(detailResponse.data);
item.pubDate = parseDate(content('div[itemprop="datePublished"]').first().attr('content'));
item.updated = parseDate(content('div[itemprop="datePublished"]').last().attr('content'));
item.category = content('span[data-type="tags"]')
.first()
.find('a')
@ -65,6 +66,7 @@ const ProcessItems = async (ctx, currentUrl, rootUrl) => {
images: content('.img_zoom_img img')
.toArray()
.map((image) => content(image).attr('data-original')),
cover: content('.thumb-overlay img').first().attr('src'),
});
return item;