# Project page copy (Malaysia) — SEO plan T407 / T412

**Context:** a part of [Project Detail](/docs/modules_handbook/main/project-detail/readMe.md) ·
**Code:** `App\Support\ProjectCopy`, `resources/content/project-pages/my.json`,
`ProjectDetailController::show()` · **Tests:** `tests/Feature/Main/ProjectCopyTest.php`,
`resources/js/Pages/Main/Site/projectDetail.test.js`

## What it does

Each public Malaysia project page (`/my/projects/{slug}`) can carry copy written for it: an SEO
title, a meta description, a 150–300 word overview, four FAQ and links to the glossary terms a
buyer should read first. The copy is written only from our own catalogue data (Peta V3), so it
replaces the developer's marketing text that the catalogue's `description` usually holds.

| Where | What the copy changes |
|---|---|
| English URL `/my/projects/{slug}` (also Bahasa Malaysia, which shares it) | `<title>` (`seoTitle` + " · PropertyLab"), meta description, the Overview text, a visible FAQ with FAQPage JSON-LD, "Before you buy" glossary links |
| Chinese twin `/zh-hans/my/projects/{slug}` | the Overview text only. The title, meta description and FAQ stay translated (Chinese). |
| Other markets (HK, SG, UAE) | nothing |

## Draft and approved

Every page in `my.json` has `status`:

- `draft` — written, not yet reviewed. Shown only where `config('guides.show_drafts')` is on, and
  the page (English and Chinese) is then served `noindex, follow`. The switch is on by default
  wherever `SEO_CANONICAL_URL` is not set (dev workspaces, previews) and **off in production**.
  Set `GUIDES_SHOW_DRAFTS=false` in the production `.env` as well, so it never depends on the
  other setting.
- `approved` — reviewed against the catalogue record; shown everywhere, indexed normally.
  `checkedBy` must name the reviewer (the test fails otherwise).

The review happens in the SEO Google Sheet, tab 项目页重写 (column U). A page marked 已批准
there is copied into `my.json` as `approved` with `checkedBy` filled.

## The developer's raw description

Pages without written copy still show the catalogue `description`. Many of those were pasted from
a web page and lost their line breaks ("…investment value.The Ultimate…"). The Overview tab runs
them through `tidyDescription()` (`projectDetail.js`), which puts a paragraph break back where a
sentence ends and the next starts with no space. Headings glued to text without punctuation
("…from TRXDeveloped by…") cannot be told apart from names and stay as they are; the fix for
those is written copy or a cleaned description in Manage.

## Keeping the copy true

Every number in the copy (price range, units, completion, bedrooms, sizes, management fee,
station distance) came from the record on the date in `updated`. When a record changes, the copy
must change too. The SEO routine checks 10 pages each Tuesday and Thursday and flags drift in the
sheet (状态 需修改); the change then goes into `my.json` the same way as an approval.

## Limits the file must stay within

`ProjectCopyTest::test_the_copy_file_stays_within_the_page_template` checks the real file:
`seoTitle` ≤ 51 characters (65 with the suffix), `seoDescription` ≤ 155, 3–4 overview paragraphs
of 150–300 words, exactly 4 FAQ, `slug` equal to its key, `status` draft or approved.

## Going live (T412)

1. Approvals: the reviewer marks pages 已批准 in the sheet; their entries become `approved`.
2. Deploy the files in the PR (ProjectCopy, the controller and Overview tab changes, `my.json`,
   the tests, this page). Nothing in the database changes; drafts stay invisible in production.
3. After deploy, open a few approved pages on propertylabglobal.com: the title, meta
   description, overview and FAQ match the sheet, and the page is not noindex.
4. Long term (decision D16): move the copy into catalogue fields editable in Manage, import
   `my.json` once, then retire the file.
