Skip to content

Commit

Permalink
fix(route): 华中科技大学研究生院标题不完整 (#17478)
Browse files Browse the repository at this point in the history
  • Loading branch information
nczitzk authored Nov 6, 2024
1 parent 9f77cb9 commit 9856a2a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/routes/hust/gs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 9856a2a

Please sign in to comment.