feat(route): Optimize the title of Caixin Weekly | 优化《财新周刊》标题 (#14396)

* 优化标题

* feat(route): Optimize the title of Caixin Weekly
This commit is contained in:
Kawauso
2024-02-05 19:46:49 +08:00
committed by GitHub
parent c93226cdff
commit acfcd0cafc
+2 -2
View File
@@ -27,7 +27,7 @@ module.exports = async (ctx) => {
const { data } = await got(item.link);
const $ = cheerio.load(data);
item.title = $('head title').text();
item.title = $('head title').text().replace(/_财新周刊频道_财新网$/, '').trim();
item.pubDate = parseDate(
$('.source')
.text()
@@ -47,7 +47,7 @@ module.exports = async (ctx) => {
);
ctx.state.data = {
title: $('head title').text(),
title: $('head title').text().replace(/_财新周刊频道_财新网$/, '').trim(),
link,
item: items,
};