- บทความจากหลังบ้าน: /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 ไฟล์)
57 lines
1.9 KiB
TypeScript
57 lines
1.9 KiB
TypeScript
import { ArticlePage } from "@/components/site/ArticlePage";
|
|
import { APP_TITLE } from "@/lib/app-config";
|
|
import { useContent } from "@/lib/content-context";
|
|
import { useI18n } from "@/lib/i18n";
|
|
import { DEFAULT_LOCALE, MESSAGES } from "@/lib/i18n/messages";
|
|
import { resolvePageOrigin } from "@/lib/page-origin";
|
|
import {
|
|
articleJsonLd,
|
|
breadcrumbJsonLd,
|
|
originFromMatches,
|
|
pageMeta,
|
|
} from "@/lib/seo";
|
|
|
|
const HEAD_MESSAGES = MESSAGES[DEFAULT_LOCALE];
|
|
|
|
/** meta() ของ route ลูกอ่าน origin ที่ root loader หาไว้ (ไม่ฝังโดเมน) */
|
|
type MetaArgs = { matches?: Array<{ id?: string; data?: unknown }> };
|
|
|
|
export async function loader({ request }: { request: Request }) {
|
|
return { origin: resolvePageOrigin(request) };
|
|
}
|
|
|
|
export function meta({ loaderData }: { loaderData?: { origin?: string } }) {
|
|
const origin = loaderData?.origin ?? "";
|
|
const title = `${HEAD_MESSAGES.forCinemas.title} — AlterFlixHub`;
|
|
const description = HEAD_MESSAGES.forCinemas.lead;
|
|
return [
|
|
...pageMeta({
|
|
origin,
|
|
title,
|
|
description,
|
|
path: "/for-cinemas",
|
|
type: "article",
|
|
}),
|
|
...breadcrumbJsonLd(origin, [
|
|
{ name: "หน้าแรก", path: "/" },
|
|
{ name: HEAD_MESSAGES.forCinemas.title, path: "/for-cinemas" },
|
|
]),
|
|
...articleJsonLd({
|
|
origin,
|
|
headline: HEAD_MESSAGES.forCinemas.title,
|
|
description,
|
|
path: "/for-cinemas",
|
|
}),
|
|
];
|
|
}
|
|
|
|
/** หน้า "สำหรับคนทำโรงหนัง" — บทความแบบบล็อกที่แก้ได้จากหลังบ้าน (`forCinemas`) */
|
|
export default function ForCinemasRoute() {
|
|
const { messages, locale } = useI18n();
|
|
const { forCinemas } = useContent();
|
|
|
|
return (
|
|
<ArticlePage content={forCinemas[locale]} backLabel={messages.nav.home} />
|
|
);
|
|
}
|