Rename hidden image folder .resource/ to .image/
.resource/ clashed with resource/ (the tracked data folder), so rename the hidden image folder to .image/ for clarity. Re-zip resource/images.zip to contain .image/ and update setup.sh, .gitignore, README.md, AGENTS.md and all image references in ui/.
This commit is contained in:
1 parent
670afcb773
commit
82aafdc61f
15 files changed
+81
-81
No files matched your search
@@ -18,14 +18,14 @@ web-at-transit-mock/
|
||||
├── resource/
|
||||
│ ├── data/ ← ข้อมูล mock: routes.json, schedules.json, stations.json, ...
|
||||
│ └── images.zip ← ★ รูปทั้งหมด (บีบไว้ — แตกด้วย setup.sh)
|
||||
└── .resource/ ← รูปทั้งหมด (hidden — เกิดหลังรัน setup.sh, ไม่ commit)
|
||||
└── .image/ ← รูปทั้งหมด (hidden — เกิดหลังรัน setup.sh, ไม่ commit)
|
||||
```
|
||||
|
||||
## วิธี run
|
||||
|
||||
```bash
|
||||
cd web-at-transit-mock
|
||||
./setup.sh # 1. แตก resource/images.zip → .resource/ (ครั้งเดียว)
|
||||
./setup.sh # 1. แตก resource/images.zip → .image/ (ครั้งเดียว)
|
||||
python3 -m http.server 8090 # 2. รัน static server
|
||||
```
|
||||
|
||||
@@ -37,25 +37,25 @@ http://localhost:8090/ui/index.html
|
||||
|
||||
### เงื่อนไขสำคัญ
|
||||
|
||||
1. **ต้องรัน `./setup.sh` ก่อน** — ไม่งั้นรูปพังทั้งหน้า (relative path `../.resource/...` หาไฟล์ไม่เจอ)
|
||||
1. **ต้องรัน `./setup.sh` ก่อน** — ไม่งั้นรูปพังทั้งหน้า (relative path `../.image/...` หาไฟล์ไม่เจอ)
|
||||
2. **ต้อง serve จาก root ของ repo** (ไม่ใช่จาก `ui/`) — รูปและข้อมูลอ้างอิงด้วย relative path
|
||||
3. **ห้ามเปิด `file://`** — fetch JSON + relative path จะใช้ไม่ได้ ต้องผ่าน static server เสมอ
|
||||
4. เปลี่ยน port ได้โดยแก้เลข `8090` (เช่น `python3 -m http.server 8080`)
|
||||
|
||||
## การจัดการรูปภาพ (images)
|
||||
|
||||
รูปทั้งหมด (~31MB) อยู่ใน folder hidden `.resource/` (ถูก `.gitignore` → ไม่ push ขึ้น git)
|
||||
รูปทั้งหมด (~31MB) อยู่ใน folder hidden `.image/` (ถูก `.gitignore` → ไม่ push ขึ้น git)
|
||||
โดยแจกผ่านไฟล์เดียว `resource/images.zip`:
|
||||
|
||||
- **แตกไฟล์**: `./setup.sh` (idempotent — ถ้ามี `.resource/` แล้วจะข้าม)
|
||||
- **เพิ่ม/เปลี่ยนรูป**: แก้ที่ `.resource/` แล้ว re-zip:
|
||||
- **แตกไฟล์**: `./setup.sh` (idempotent — ถ้ามี `.image/` แล้วจะข้าม)
|
||||
- **เพิ่ม/เปลี่ยนรูป**: แก้ที่ `.image/` แล้ว re-zip:
|
||||
|
||||
```bash
|
||||
zip -r -X resource/images.zip .resource -x "*.DS_Store"
|
||||
zip -r -X resource/images.zip .image -x "*.DS_Store"
|
||||
```
|
||||
|
||||
แล้ว commit `resource/images.zip`
|
||||
- **ห้าม commit ไฟล์ใน `.resource/`** — อยู่ใน `.gitignore` แล้ว
|
||||
- **ห้าม commit ไฟล์ใน `.image/`** — อยู่ใน `.gitignore` แล้ว
|
||||
|
||||
## หมายเหตุ (ไม่ต้องแก้)
|
||||
|
||||
|
||||
Reference in new issue
Block a user