fix(route): 华中科技大学研究生院标题不完整 (#17478)

This commit is contained in:
Ethan Shen 2024-11-07 00:14:20 +08:00 committed by GitHub
parent 9f77cb9348
commit 9856a2a2fc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 3 deletions

View File

@ -57,11 +57,12 @@ export const handler = async (ctx) => {
)
);
const image = new URL($('div.logo img').prop('content'), rootUrl).href;
const title = $('meta[name="keywords"]').prop('content')?.replace(/,/g, ' - ') ?? $('title').text();
const image = new URL($('div.logo img').prop('src'), rootUrl).href;
return {
title: $('title').text(),
description: $('META[Name="keywords"]').prop('Content'),
title,
description: title.split(/-/).pop()?.trim(),
link: currentUrl,
item: items,
allowEmpty: true,