diff options
| author | Yasutake Yohei <61961825+yasutakeyohei@users.noreply.github.com> | 2026-11-08 09:51:42 +0900 |
|---|---|---|
| committer | Yasutake Yohei <61961825+yasutakeyohei@users.noreply.github.com> | 2026-11-08 09:51:42 +0900 |
| commit | 0e15785145fa23a4cc5bf5856ead421610b28510 (patch) | |
| tree | 5e6ee8baa62cef4d47a726d4ed5431a289c8096f | |
| parent | aefd89227ce390d5220563d8112fc026ea3c7e45 (diff) | |
Search Consoleで「項目 description がありません」と指摘されていた。
ページサイズを抑えるために外していたが、時刻・場所・申込みの記載を
100字までに切って説明文として入れた。
| -rw-r--r-- | src/components/ScheduleSeo.astro | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/components/ScheduleSeo.astro b/src/components/ScheduleSeo.astro index fcf6898..a66ebc4 100644 --- a/src/components/ScheduleSeo.astro +++ b/src/components/ScheduleSeo.astro @@ -73,6 +73,12 @@ const venueOf = (place: string) => { return /時|から|まで|予約|配布|配信|申込|[0-90-9]/.test(text) ? '' : text.trim(); }; +// 構造化データ用の説明文。時刻と場所、申込みなどの記載を短くまとめる。 +const describe = (place: string, note: string) => { + const text = [timeOf(place), stripTags(note)].filter(Boolean).join('/'); + return text.length > 100 ? `${text.slice(0, 100)}…` : text; +}; + type Row = { date: string; title: string; place: string; note: string }; // ビルド日以降に開催されるイベントを、開催日の早い順に出力する。 @@ -121,6 +127,7 @@ const eventList = { '@type': 'Event', name: plainName(row.title), startDate: dates[0], + description: describe(row.place, row.note), eventStatus: 'https://schema.org/EventScheduled', eventAttendanceMode: 'https://schema.org/OfflineEventAttendanceMode', location: { |
