From 8c2b29f889c75d1d3962d5a3a7b8f9536aebddbe Mon Sep 17 00:00:00 2001 From: Yasutake Yohei <61961825+yasutakeyohei@users.noreply.github.com> Date: Wed, 18 Nov 2026 00:09:09 +0900 Subject: Pubcomments.astro: パブコメ欄をJSONから自動生成するように統合 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 本文のパブコメ欄と日別一覧の「受付中」表示が同じ pubcomments.json を参照するようにした。募集中・これからの募集・終了した募集はビルド日から自動で振り分ける。 --- src/components/Pubcomments.astro | 62 +++++++++++++++++++++++++++++++++++++ src/content/docs/kodaira/events.mdx | 17 ++-------- src/data/schedule/pubcomments.json | 25 +++++++++++++-- 3 files changed, 86 insertions(+), 18 deletions(-) create mode 100644 src/components/Pubcomments.astro diff --git a/src/components/Pubcomments.astro b/src/components/Pubcomments.astro new file mode 100644 index 0000000..73521cd --- /dev/null +++ b/src/components/Pubcomments.astro @@ -0,0 +1,62 @@ +--- +// パブリックコメントの一覧。データは src/data/schedule/pubcomments.json から生成する +// (日別一覧の「受付中」表示も同じJSONを使う)。 +import pubcomments from '@/data/schedule/pubcomments.json'; + +const pad = (n: number) => String(n).padStart(2, '0'); +const now = new Date(); +const todayKey = `${now.getFullYear()}-${pad(now.getMonth() + 1)}-${pad(now.getDate())}`; + +const reiwa = (iso: string) => { + const [y, m, d] = iso.split('-').map(Number); + const year = y - 2018 === 1 ? '令和元年' : `令和${y - 2018}年`; + return `${year}${m}月${d}日`; +}; + +const items = pubcomments.map((p) => ({ + ...p, + state: todayKey < p.from ? 'upcoming' : todayKey > p.to ? 'ended' : 'open', + toLabel: + p.from.slice(0, 4) === p.to.slice(0, 4) ? reiwa(p.to).replace(/^令和\d+年|^令和元年/, '') : reiwa(p.to), + noteText: p.note ? (p.note.endsWith('。') ? p.note : `${p.note}。`) : '', +})); + +const groups = [ + { key: 'open', label: '募集中' }, + { key: 'upcoming', label: 'これからの募集' }, + { key: 'ended', label: '終了した募集' }, +] as const; +--- + +

+ 市は、計画や条例の案について市民の意見を募るパブリックコメント(市民意見公募手続)を行っています。最新の募集状況は、市のパブリックコメントのページでご確認ください。 +

+ +{ + groups.map((group) => { + const list = items.filter((item) => item.state === group.key); + if (list.length === 0) return null; + return ( + <> +

+ {group.label} +

+ + + ); + }) +} + +

提出方法や、素案を閲覧できる場所は、それぞれのページをご覧ください。

+

(注){reiwa(todayKey)}時点の情報です。

diff --git a/src/content/docs/kodaira/events.mdx b/src/content/docs/kodaira/events.mdx index 8bebcc4..014f020 100644 --- a/src/content/docs/kodaira/events.mdx +++ b/src/content/docs/kodaira/events.mdx @@ -42,6 +42,7 @@ import ScheduleMap from '../../../components/ScheduleMap.astro'; import ScheduleSeo from '../../../components/ScheduleSeo.astro'; import ScheduleTable from '../../../components/ScheduleTable.astro'; import ScheduleMonthLinks from '../../../components/ScheduleMonthLinks.astro'; +import Pubcomments from '../../../components/Pubcomments.astro'; @@ -119,22 +120,8 @@ import ScheduleMonthLinks from '../../../components/ScheduleMonthLinks.astro'; ## パブリックコメント(市民意見の募集) -市は、計画や条例の案について市民の意見を募るパブリックコメント(市民意見公募手続)を行っています。最新の募集状況は、市の[パブリックコメントのページ](https://www.city.kodaira.tokyo.jp/pubcome/)でご確認ください。 + -**募集中** - -- **[小平市第五期地域福祉計画(素案)(令和9年度~令和17年度)](https://www.city.kodaira.tokyo.jp/pubcome/130/130689.html)**:令和8年11月16日から12月15日まで。担当は福祉政策課(042-312-1365) -- **[小平市地域包括ケア推進計画(素案)](https://www.city.kodaira.tokyo.jp/pubcome/131/131091.html)**:令和8年11月16日から12月15日まで。担当は高齢者支援課計画担当(042-346-9823)と地域包括ケア推進担当(042-346-9539) -- **[小平市障がい者計画等(素案)](https://www.city.kodaira.tokyo.jp/pubcome/130/130569.html)**:令和8年11月16日から12月15日まで。第八期小平市障害福祉計画・第四期小平市障害児福祉計画の素案を含みます。担当は障がい者支援課相談支援制度担当(042-312-1385) - -提出方法や、素案を閲覧できる場所は、それぞれのページをご覧ください。 - -**終了した募集** - -- **小平市都市計画マスタープランの改定に係るパブリックコメント**:令和8年9月25日から**11月1日まで**(当初は10月24日まででしたが延長)。**受付は終了**しています。現在、市がいただいた意見に対する考え方を検討中で、結果はまとまり次第公表されます(政策決定は令和9年3月予定)。担当は都市計画課(042-346-9554) -- **小平市交通安全計画(素案)**:令和8年6月13日から7月12日まで(受付終了)。担当は交通対策課(042-346-9827) - -(注)令和8年11月17日時点の情報です。 ## 月別のアーカイブ diff --git a/src/data/schedule/pubcomments.json b/src/data/schedule/pubcomments.json index 3347ac9..bb4f3f4 100644 --- a/src/data/schedule/pubcomments.json +++ b/src/data/schedule/pubcomments.json @@ -4,20 +4,39 @@ "from": "2026-11-16", "to": "2026-12-15", "url": "https://www.city.kodaira.tokyo.jp/pubcome/130/130689.html", - "contact": "福祉政策課 042-312-1365" + "contact": "福祉政策課 042-312-1365", + "note": "" }, { "title": "小平市地域包括ケア推進計画(素案)", "from": "2026-11-16", "to": "2026-12-15", "url": "https://www.city.kodaira.tokyo.jp/pubcome/131/131091.html", - "contact": "高齢者支援課計画担当 042-346-9823" + "contact": "高齢者支援課計画担当 042-346-9823、地域包括ケア推進担当 042-346-9539", + "note": "" }, { "title": "小平市障がい者計画等(素案)", "from": "2026-11-16", "to": "2026-12-15", "url": "https://www.city.kodaira.tokyo.jp/pubcome/130/130569.html", - "contact": "障がい者支援課相談支援制度担当 042-312-1385" + "contact": "障がい者支援課相談支援制度担当 042-312-1385", + "note": "第八期小平市障害福祉計画・第四期小平市障害児福祉計画の素案を含みます。" + }, + { + "title": "小平市都市計画マスタープランの改定に係るパブリックコメント", + "from": "2026-09-25", + "to": "2026-11-01", + "url": "https://www.city.kodaira.tokyo.jp/pubcome/130/130030.html", + "contact": "都市計画課 042-346-9554", + "note": "当初は10月24日まででしたが延長しました。現在、市がいただいた意見に対する考え方を検討中で、結果はまとまり次第公表されます(政策決定は令和9年3月予定)。" + }, + { + "title": "小平市交通安全計画(素案)", + "from": "2026-06-13", + "to": "2026-07-12", + "url": "https://www.city.kodaira.tokyo.jp/pubcome/127/127675.html", + "contact": "交通対策課 042-346-9827", + "note": "" } ] -- cgit v1.3.1