# Product detail template kit

This directory is the collaboration surface for product-detail UI work.

## Scope

Included:

- the canonical product-detail HTML template;
- fixed, non-production preview fixtures;
- a local preview renderer with no network or production credentials;
- template-focused tests.

Not included:

- production product data;
- D1 access or synchronization;
- R2 upload or deletion commands;
- Cloudflare credentials;
- production HTML publishing or rollback.

## Edit the template

The canonical template is:

```text
product-pages/templates/product_detail_template.html
```

Keep every `__PLACEHOLDER__` intact unless the rendering contract is explicitly changed in the same pull request.

## Render a safe local preview

Run from the repository root:

```bash
python3 product-pages/preview/render_preview.py
python3 -m http.server 4173 --directory .
```

Then open:

```text
http://127.0.0.1:4173/product-pages/.preview/71v416l10beg.html
```

The preview renderer uses only the checked-in fixture and blocks form submission. Its output is ignored by Git and must not be treated as production HTML.

To render a different checked-in fixture:

```bash
python3 product-pages/preview/render_preview.py \
  --fixture product-pages/fixtures/71v416l10beg.json \
  --output product-pages/.preview/71v416l10beg.html
```

## Test

```bash
python3 -m unittest tests.test_product_page_template_kit
```

Pull requests from specific AI / 数字员工 should contain template or approved presentation-layer changes only, together with desktop/mobile screenshots and test evidence. Formal product-page generation and production publication remain outside this repository workflow.
