diff options
Diffstat (limited to 'src/components/ScheduleInteractive.astro')
| -rw-r--r-- | src/components/ScheduleInteractive.astro | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/src/components/ScheduleInteractive.astro b/src/components/ScheduleInteractive.astro index 8877d9d..19a3f59 100644 --- a/src/components/ScheduleInteractive.astro +++ b/src/components/ScheduleInteractive.astro @@ -1,6 +1,5 @@ <script> // URLは src/data/schedule/config.ts で一元管理している(ページ移転時はそこだけ変える) - import { scheduleAbsoluteUrl } from '@/data/schedule/config'; import { parseDates, applyExclusions, toKey, keyToDate, entryDates, mainStartMonth, normalizeDigits } from '@/lib/schedule-dates'; const CATEGORY_DEFS = [ @@ -486,59 +485,6 @@ }); } - // 検索エンジン向けに、これからのイベントを構造化データ(JSON-LD)で出力する。 - function emitEventStructuredData() { - const upcoming = entries - .filter((e) => e.type === 'event' && e.dates.some((d) => d >= todayKey)) - .map((e) => { - const future = e.dates.filter((d) => d >= todayKey).sort(); - const name = e.name.startsWith(e.category) - ? e.name.slice(e.category.length).trim() - : e.name; - const parts = e.time.split('/'); - const venue = (parts[1] ?? '').trim(); - return { - '@type': 'Event', - name, - startDate: future[0], - eventStatus: 'https://schema.org/EventScheduled', - eventAttendanceMode: 'https://schema.org/OfflineEventAttendanceMode', - location: { - '@type': 'Place', - name: venue || '小平市', - address: { - '@type': 'PostalAddress', - addressLocality: '東京都小平市', - addressCountry: 'JP', - }, - }, - description: e.time, - url: scheduleAbsoluteUrl(`#${e.rowId}`), - }; - }) - .sort((a, b) => a.startDate.localeCompare(b.startDate)) - .slice(0, 40); - - const existing = document.getElementById('schedule-event-ldjson'); - if (existing) existing.remove(); - if (upcoming.length === 0) return; - - const script = document.createElement('script'); - script.type = 'application/ld+json'; - script.id = 'schedule-event-ldjson'; - script.textContent = JSON.stringify({ - '@context': 'https://schema.org', - '@type': 'ItemList', - name: '小平市のこれからのイベント', - itemListElement: upcoming.map((item, index) => ({ - '@type': 'ListItem', - position: index + 1, - item, - })), - }); - document.head.appendChild(script); - } - // 件数はフィルターのボタンには出さず、ページ下部にまとめて表示する。 function renderCategorySummary() { const summaryEl = document.getElementById('schedule-category-summary'); @@ -553,7 +499,6 @@ buildFilters(); renderCategorySummary(); - emitEventStructuredData(); applyFilter(); renderCalendar(); if (selectedDate) showDayDetails(selectedDate); |
