fix(route): 华尔街见闻实时快讯图片 (#10925)
This commit is contained in:
@@ -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 = {
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
{{ if description }}
|
||||
{{@ description }}
|
||||
{{ /if }}
|
||||
{{ if more }}
|
||||
{{@ more }}
|
||||
{{ /if }}
|
||||
{{ if images }}
|
||||
{{ each images image }}
|
||||
<img src="{{ image.uri }}" width="{{ image.width }}" height="{{ image.height }}">
|
||||
{{ /each }}
|
||||
{{ /if }}
|
||||
Reference in New Issue
Block a user