feat: บทความ 2 หน้า + แชร์/ลิงก์ย่อ + PWA + แอนิเมชัน + SEO/AI + เอกสาร
- บทความจากหลังบ้าน: /for-film-lovers, /for-cinemas (ArticlePage + ArticleEditor แบบบล็อกย่อหน้า/รูป) - แชร์: ปุ่มบนการ์ดและท้ายหน้ารายละเอียด · ลิงก์ย่อ /c/<slug> (302) · ธีมแก้วตาม DESIGN.md - PWA: manifest/sw/offline + ถอดการล็อกซูม (WCAG 1.4.4) + touch target ≥44px - แอนิเมชัน reveal: IntersectionObserver + gate ด้วย html.fx-motion · เคารพ prefers-reduced-motion - ค้นหา: normalize/ตัดวรรณยุกต์ + AND หลายคำ + จัดอันดับ · รองรับ /?q= จาก SearchAction - SEO: pageMeta (canonical/OG/Twitter) + JSON-LD (WebSite/Organization/BreadcrumbList/MovieTheater/Article) - ไม่ฝังโดเมนในโค้ด: origin มาจาก request (x-forwarded-host/proto) ทั้ง canonical, sitemap, robots, ลิงก์แชร์ - กัน AI: robots.txt (Nitro route, บล็อก AI 21 ตัว) + ai.txt + OG image 1200x630 - เอกสาร: README สรุปโปรเจกต์, DESIGN.md (motion/PWA/SEO/ข้อมูล), architecture.html, admin-guide - tests: 135 ผ่าน (16 ไฟล์)
This commit is contained in:
1 parent
1e84023a44
commit
319c271d23
72 files changed
+4731
-765
No files matched your search
+4
-29
@@ -4,9 +4,9 @@
|
||||
* ข้อความอังกฤษเป็นฟิลด์เสริม (*_en) ถ้าไม่กรอกจะ fallback เป็นไทย
|
||||
*/
|
||||
|
||||
import type { Coordinates } from "@/lib/geo";
|
||||
import type { FacilityKey, Locale, Messages } from "@/lib/i18n/messages";
|
||||
import { FACILITY_KEYS } from "@/lib/i18n/messages";
|
||||
import type { Coordinates } from "@/lib/geo";
|
||||
|
||||
export type TransportMode = {
|
||||
/** ใช้เลือกไอคอนและชื่อวิธีเดินทางจากข้อความแปล */
|
||||
@@ -332,9 +332,9 @@ export function cinemaFacilities(cinema: Cinema): FacilityKey[] {
|
||||
}
|
||||
|
||||
/** หมวดที่เลือกได้ในหลังบ้าน — ตัด "ทั้งหมด" ออกเพราะใช้เป็นตัวกรอง "ไม่กรอง" */
|
||||
export const ASSIGNABLE_CATEGORIES: CinemaCategory[] =
|
||||
CINEMA_CATEGORIES.filter((category) => category !== DEFAULT_CATEGORY);
|
||||
|
||||
export const ASSIGNABLE_CATEGORIES: CinemaCategory[] = CINEMA_CATEGORIES.filter(
|
||||
(category) => category !== DEFAULT_CATEGORY,
|
||||
);
|
||||
|
||||
export function transportValue(route: TransportMode, locale: Locale): string {
|
||||
return pick(route.value, route.value_en, locale);
|
||||
@@ -352,31 +352,6 @@ export function hasCategory(cinema: Cinema, category: CinemaCategory): boolean {
|
||||
return category === DEFAULT_CATEGORY || cinema.tags.includes(category);
|
||||
}
|
||||
|
||||
export function matchesQuery(cinema: Cinema, query: string): boolean {
|
||||
const keyword = query.trim().toLowerCase();
|
||||
if (keyword === "") return true;
|
||||
return (
|
||||
cinema.name.toLowerCase().includes(keyword) ||
|
||||
cinema.location_label.toLowerCase().includes(keyword) ||
|
||||
(cinema.location_label_en ?? "").toLowerCase().includes(keyword)
|
||||
);
|
||||
}
|
||||
|
||||
export function filterCinemas(
|
||||
cinemas: Cinema[],
|
||||
{
|
||||
category,
|
||||
query,
|
||||
}: {
|
||||
category: CinemaCategory;
|
||||
query: string;
|
||||
},
|
||||
): Cinema[] {
|
||||
return cinemas.filter(
|
||||
(cinema) => hasCategory(cinema, category) && matchesQuery(cinema, query),
|
||||
);
|
||||
}
|
||||
|
||||
export function findCinemaBySlug(
|
||||
cinemas: Cinema[],
|
||||
slug: string | undefined,
|
||||
|
||||
Reference in new issue
Block a user