aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/components/ScheduleSeo.astro7
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: {