Skip to content

Commit 5333db2

Browse files
committed
docs: update README and CLAUDE.md for contact card system
Add contact card documentation with all 8 supported types, variable reference for speedtest_url, and development notes for main.py hook and MkDocs v1 pin.
1 parent bbbdbd6 commit 5333db2

2 files changed

Lines changed: 42 additions & 1 deletion

File tree

CLAUDE.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ MkDocs documentation templates with `mkdocs-macros-plugin` for Jinja2 variable s
66

77
- `plex-guide/` — Plex server user guide template
88
- `docs/index.md` — templatized guide with `{{ variable }}` references
9+
- `main.py` — mkdocs-macros hook: `contact_card()` macro + frontmatter resolution
910
- `mkdocs.sample.yml` — sample config (users copy to `mkdocs.yml`, which is gitignored)
1011
- `setup.sh` — interactive setup script
11-
- `requirements.txt` — minimal pip dependencies
12+
- `requirements.txt` — minimal pip dependencies (mkdocs pinned to v1)
1213
- `plans/`, `runbooks/` — future template directories
1314

1415
## Key Patterns
@@ -34,10 +35,23 @@ MkDocs documentation templates with `mkdocs-macros-plugin` for Jinja2 variable s
3435
- CI runs markdownlint, shellcheck, yamllint on all PRs
3536
- GitHub Pages deploys from GHA workflow (plex guide at `/plex/` subpath)
3637

38+
## Contact Card System
39+
40+
`main.py` provides a `contact_card()` macro with bot-protected contact info:
41+
42+
- Values are base64-encoded at build time, decoded by JS at runtime
43+
- Inline CSS styles the card (border, rounded corners, dividers, preferred badge)
44+
- Supported types: `email`, `phone`, `signal_url`, `signal_username`, `telegram`, `discord`, `whatsapp`, `imessage`
45+
- `signal_username` and `discord` render as plain text (no clickable link)
46+
- `telegram``t.me/`, `whatsapp``wa.me/`, `imessage``sms:`, `phone``tel:`
47+
- `noscript` fallback shows values without JS decoding
48+
3749
## Rules
3850

3951
- This is a **public repo** — no local paths, infrastructure refs, or personal config
4052
- All scripts must pass `shellcheck` with no warnings
4153
- All markdown must pass `markdownlint-cli2` with the repo's `.markdownlint.yaml`
4254
- New variables must be added to: `mkdocs.sample.yml`, `setup.sh`, `README.md` variable reference
55+
- New contact types must be added to: `main.py` (JS decoder + `_build_href` + `_display_value`), `mkdocs.sample.yml`
4356
- Conditional sections must toggle cleanly (no empty sections or broken refs when disabled)
57+
- MkDocs pinned to v1 (`>=1.6,<2`) — v2 removes plugin system with no migration path

README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,33 @@ Set to `true` to show the section, `false` to hide it.
125125
| `has_migration` | `false` | Watch history migration section |
126126
| `show_costs` | `false` | Server cost information |
127127
| `server_cost` | `""` | Monthly cost string |
128+
| `speedtest_url` | `""` | Speed test URL (falls back to `fast.com`) |
129+
130+
### Contact Card
131+
132+
The `contact_methods` variable configures a bot-protected contact card at the bottom of the guide. Values are base64-encoded at build time and decoded by JavaScript at runtime.
133+
134+
```yaml
135+
contact_methods:
136+
- type: signal_url
137+
label: "Message on Signal"
138+
value: "https://signal.me/#eu/..."
139+
preferred: true # Shows a "preferred" badge
140+
- type: email
141+
label: "Email"
142+
value: "admin@example.com"
143+
```
144+
145+
| Type | Behavior | Value Format |
146+
|------|----------|--------------|
147+
| `email` | `mailto:` link | `admin@example.com` |
148+
| `phone` | `tel:` link | `+15551234567` |
149+
| `signal_url` | Clickable Signal invite | `https://signal.me/#eu/...` |
150+
| `signal_username` | Plain text (no link) | `username.123` |
151+
| `telegram` | `t.me/` link | `username` |
152+
| `discord` | Plain text (no link) | `username` |
153+
| `whatsapp` | `wa.me/` link | `+15551234567` |
154+
| `imessage` | `sms:` link | `+15551234567` |
128155

129156
## How It Works
130157

0 commit comments

Comments
 (0)