|
| 1 | +<?php |
| 2 | +/** |
| 3 | + * site.php — サイト全体の設定ファイル |
| 4 | + * |
| 5 | + * 基本値を定義しつつ、年度ごとの可変データは data/config.json から上書きします。 |
| 6 | + * Do `require __DIR__ . '/../config/site.php';` to load $site_config. |
| 7 | + */ |
| 8 | +$site_config = [ |
| 9 | + |
| 10 | + // ── 基本情報 ──────────────────────────────────────────────── |
| 11 | + 'year' => '2025', // 開催年度 |
| 12 | + 'festival_name' => '高専祭', // 祭名(年度を含まない) |
| 13 | + 'school_name' => '仙台高等専門学校広瀬キャンパス', |
| 14 | + 'committee_name' => '高専祭実行委員会', |
| 15 | + |
| 16 | + // ── テーマ ────────────────────────────────────────────────── |
| 17 | + 'theme' => '彩風', // テーマ名 |
| 18 | + 'theme_reading' => 'あやかぜ', // テーマ読み |
| 19 | + 'theme_description' => '個性豊かな出店や企画の彩りが、それぞれの色を持ちながらも一つに重なり合い、秋風のように心地よく高専祭全体を包み込む、そんなあたたかく一体感のあるイベントにしたい', |
| 20 | + |
| 21 | + // ── 開催日程 ──────────────────────────────────────────────── |
| 22 | + 'dates' => [ |
| 23 | + ['label' => '一日目', 'date' => '10月25日(土)', 'time' => '9:30-16:00'], |
| 24 | + ['label' => '二日目', 'date' => '10月26日(日)', 'time' => '9:30-15:00'], |
| 25 | + ], |
| 26 | + 'dates_note' => '※時間は変更になる可能性があります。', |
| 27 | + |
| 28 | + // ── アクセス ──────────────────────────────────────────────── |
| 29 | + 'access' => [ |
| 30 | + 'JR仙山線 愛子駅より徒歩15分', |
| 31 | + '仙台市営バス 仙台高専広瀬キャンパス入口より徒歩5分', |
| 32 | + ], |
| 33 | + |
| 34 | + // ── SNS ───────────────────────────────────────────────────── |
| 35 | + 'sns' => [ |
| 36 | + 'x' => 'https://x.com/Kosensai_Zitsui', |
| 37 | + 'instagram' => 'https://www.instagram.com/hirosekousensai/', |
| 38 | + ], |
| 39 | + |
| 40 | + // ── パンフレット ───────────────────────────────────────────── |
| 41 | + 'pamphlet_file' => 'kosensai2025_pamphlet.pdf', // attachment/ 以下のファイル名 |
| 42 | + |
| 43 | + // ── URL・パス ──────────────────────────────────────────────── |
| 44 | + // サーバー上のプロジェクトルートパス(先頭・末尾スラッシュ付き) |
| 45 | + // 例: GitHub Pages で /2026/ にデプロイするなら '/2026/' に変更する |
| 46 | + 'base_path' => '/2025/', |
| 47 | + |
| 48 | + // ── OGP デフォルト ────────────────────────────────────────── |
| 49 | + 'ogp_image_default' => 'images/hp_icon.webp', |
| 50 | +]; |
| 51 | + |
| 52 | +$config_path = __DIR__ . '/../data/config.json'; |
| 53 | +if (is_file($config_path)) { |
| 54 | + $json = json_decode(file_get_contents($config_path), true); |
| 55 | + if (is_array($json)) { |
| 56 | + if (!empty($json['year'])) { |
| 57 | + $site_config['year'] = (string) $json['year']; |
| 58 | + } |
| 59 | + if (!empty($json['school_name'])) { |
| 60 | + $site_config['school_name'] = (string) $json['school_name']; |
| 61 | + } |
| 62 | + if (!empty($json['theme'])) { |
| 63 | + $site_config['theme'] = (string) $json['theme']; |
| 64 | + } |
| 65 | + if (!empty($json['theme_kana'])) { |
| 66 | + $site_config['theme_reading'] = (string) $json['theme_kana']; |
| 67 | + } |
| 68 | + |
| 69 | + $dates = []; |
| 70 | + if (!empty($json['date_day1'])) { |
| 71 | + [$date, $time] = array_pad(explode(' ', (string) $json['date_day1'], 2), 2, ''); |
| 72 | + $dates[] = ['label' => '一日目', 'date' => $date, 'time' => $time]; |
| 73 | + } |
| 74 | + if (!empty($json['date_day2'])) { |
| 75 | + [$date, $time] = array_pad(explode(' ', (string) $json['date_day2'], 2), 2, ''); |
| 76 | + $dates[] = ['label' => '二日目', 'date' => $date, 'time' => $time]; |
| 77 | + } |
| 78 | + if ($dates !== []) { |
| 79 | + $site_config['dates'] = $dates; |
| 80 | + } |
| 81 | + } |
| 82 | +} |
| 83 | + |
| 84 | +$site_config['festival_label'] = $site_config['festival_name'] . $site_config['year']; |
| 85 | +$site_config['base_path'] = '/' . trim($site_config['year'], '/') . '/'; |
| 86 | +$site_config['pamphlet_file'] = 'kosensai' . $site_config['year'] . '_pamphlet.pdf'; |
| 87 | +$site_config['ogp_image_default'] = 'images/hp_icon.webp'; |
0 commit comments