Tina CMS Integration Log
Session: 2026-02-28, ~14:20–15:00
What Was Done
Section titled “What Was Done”1. Root package.json created
Section titled “1. Root package.json created”- Path:
~/Obsidian/baseworks-kb-shared-brain/package.json - Added
tinacms(^2.6.0) and@tinacms/cli(^1.6.0) as devDependencies - Scripts:
npm run devwraps Tina + Astro together,npm run buildruns Tina build then Astro build
2. Tina config created
Section titled “2. Tina config created”- Path:
tina/config.tsat repo root - 5 collections mapping to vault directories:
| Collection | Path | Extra Fields |
|---|---|---|
| Inbox | 00-inbox/ | — |
| Projects | 01-projects/ | status |
| Areas | 02-areas/ | format, location, program_dates, sessions |
| Resources | 03-resources/ | type |
| Archive | 04-archive/ | — |
- All collections share: title, created, updated, tags, body
- Body uses raw
stringtype (textarea) instead ofrich-text— preserves wikilinks, tables, callouts as-is - Areas collection has
match.exclude: "**/*[(]*[)]*"to skip files with parentheses in paths (Tina limitation)
3. Issues encountered and resolved
Section titled “3. Issues encountered and resolved”Parentheses in file paths
Section titled “Parentheses in file paths”- Files like
2026 (Spring) Study Group Montreal/crash Tina’s indexer - Renaming would break ~40 wikilinks across the vault
- Solution:
match.excludeglob using character classes[(]and[)](standard glob parentheses cause regex backtracking)
Numeric YAML tag values
Section titled “Numeric YAML tag values”tags: [event, tokyo, 2026, intensive]— YAML parses bare2026as an integer- Tina calls
.replace()on tag values, which fails on numbers - Fix: Quoted the numeric values in 2 files:
02-areas/educational-programs/events/2026/2026-01-tokyo-intensive/2026-01-tokyo-intensive.md02-areas/educational-programs/events/2026/2026-01-tokyo-intensive/sessions/day-1-session-1.md
rich-text body parser limitations
Section titled “rich-text body parser limitations”- Tina’s
rich-texttype can’t parse complex Obsidian markdown (tables with wikilinks, pipe characters) - Switched all body fields to
stringwithui: { component: "textarea" } - Trade-off: Tina editor shows raw markdown instead of a WYSIWYG editor, but content is preserved perfectly
4. Tina Cloud setup
Section titled “4. Tina Cloud setup”- Project created at app.tina.io under “Patrick Oancia’s Organization”
- Connected to
p-oancia/baseworks-kb-shared-brain - GitHub Authoring: “Act as self” (commits attributed to the actual editor)
- Co-authoring enabled (Patrick Oancia / pat@baseworks.com)
- Client ID:
0774d998-f43e-407b-8f2f-38d811a94b18 - Token type: Content (Read-only) — sufficient for build-time API fetching
5. GitHub Actions auto-deploy
Section titled “5. GitHub Actions auto-deploy”- Updated
.github/workflows/deploy.ymlto include Tina build step - Pipeline: Checkout → Node 20 → npm ci (root) → npm ci (site/) → tinacms build → astro build → wrangler pages deploy
- Secrets added to GitHub repo:
TINA_PUBLIC_CLIENT_IDTINA_TOKENCLOUDFLARE_API_KEY(pre-existing)CLOUDFLARE_EMAIL(pre-existing)CLOUDFLARE_ACCOUNT_ID(pre-existing)
- First deploy succeeded (run #22527910907)
6. .gitignore updated
Section titled “6. .gitignore updated”- Added:
tina/__generated__/,node_modules/,.env - Tina also generates its own
.gitignoreinsite/public/admin/
7. Local .env created
Section titled “7. Local .env created”- Path:
~/Obsidian/baseworks-kb-shared-brain/.env(not committed) - Contains
TINA_PUBLIC_CLIENT_IDandTINA_TOKEN
Current State
Section titled “Current State”- Admin panel deployed at
kb.baseworks.com/admin/index.html(behind Cloudflare Access) - Local dev:
cd ~/Obsidian/baseworks-kb-shared-brain && npm run devstarts both Tina + Astro - Auto-deploy triggers on every push to master
- Backup tag:
pre-tina-backupat commit1cf6a7e(pre-Tina state)
Files Created/Modified
Section titled “Files Created/Modified”| File | Action |
|---|---|
package.json (root) | Created |
package-lock.json (root) | Created (by npm install) |
tina/config.ts | Created |
tina/tina-lock.json | Created (by tinacms) |
.env | Created (local only, not committed) |
.gitignore | Modified (added Tina entries) |
.github/workflows/deploy.yml | Modified (added Tina build step) |
02-areas/.../2026-01-tokyo-intensive.md | Modified (quoted numeric tag) |
02-areas/.../day-1-session-1.md | Modified (quoted numeric tag) |
site/public/admin/index.html | Generated (by tinacms, git-ignored) |
Post-deploy Fixes: Admin 404
Section titled “Post-deploy Fixes: Admin 404”Two issues prevented the admin panel from loading on the production domain:
Fix 1: Nested .gitignore (commit 47a40d6)
Section titled “Fix 1: Nested .gitignore (commit 47a40d6)”Tina generates a .gitignore inside site/public/admin/ that excludes index.html and assets/. Astro copies this into site/dist/admin/.gitignore. Wrangler respects .gitignore during deploy, silently skipping the admin files.
Fix: Added a step to .github/workflows/deploy.yml that removes site/dist/admin/.gitignore before the wrangler deploy step.
Fix 2: Wrong deploy branch (the actual root cause)
Section titled “Fix 2: Wrong deploy branch (the actual root cause)”The deploy command used --branch=main but the Cloudflare Pages project has production_branch: "master". This meant all deployments went to the preview environment, not production. The custom domain kb.baseworks.com only serves production deployments.
Diagnosis: baseworks-kb.pages.dev/admin/index.html returned 404 but main.baseworks-kb.pages.dev/admin/index.html returned 200 — confirming content was deployed to preview only.
Fix: Changed --branch=main to --branch=master in .github/workflows/deploy.yml.
Verified working
Section titled “Verified working”baseworks-kb.pages.dev/admin/index.html— HTTP 200kb.baseworks.com/admin/index.html— HTTP 200 (behind Cloudflare Access)- Admin JS/CSS bundles load correctly (production build, not dev)
Remaining Work (Phase 2+)
Section titled “Remaining Work (Phase 2+)”- Test creating/editing a document through Tina admin
- Test creating/editing a document through Tina admin
- Consider adding Ksenia/Asia as a Tina Cloud collaborator
- Monitor for any frontmatter reordering issues after Tina edits
- Eventually: rename files with parentheses to remove the match.exclude workaround
Rollback
Section titled “Rollback”cd ~/Obsidian/baseworks-kb-shared-braingit reset --hard pre-tina-backupgit push --forceThis restores everything to commit 1cf6a7e (the known-good state before Tina).