From 0e15785145fa23a4cc5bf5856ead421610b28510 Mon Sep 17 00:00:00 2001 From: Yasutake Yohei <61961825+yasutakeyohei@users.noreply.github.com> Date: Sun, 8 Nov 2026 09:51:42 +0900 Subject: events: 構造化データのイベントにdescriptionを戻す MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Search Consoleで「項目 description がありません」と指摘されていた。 ページサイズを抑えるために外していたが、時刻・場所・申込みの記載を 100字までに切って説明文として入れた。 --- src/components/ScheduleSeo.astro | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src') 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: { -- cgit v1.3.1