Skip to content

Tina CMS Integration Log

Created 2026-02-28
Updated 2026-02-28
Status completed
Tags projectkb-sitetina-cmsmeta

Session: 2026-02-28, ~14:20–15:00

  • Path: ~/Obsidian/baseworks-kb-shared-brain/package.json
  • Added tinacms (^2.6.0) and @tinacms/cli (^1.6.0) as devDependencies
  • Scripts: npm run dev wraps Tina + Astro together, npm run build runs Tina build then Astro build
  • Path: tina/config.ts at repo root
  • 5 collections mapping to vault directories:
CollectionPathExtra Fields
Inbox00-inbox/
Projects01-projects/status
Areas02-areas/format, location, program_dates, sessions
Resources03-resources/type
Archive04-archive/
  • All collections share: title, created, updated, tags, body
  • Body uses raw string type (textarea) instead of rich-text — preserves wikilinks, tables, callouts as-is
  • Areas collection has match.exclude: "**/*[(]*[)]*" to skip files with parentheses in paths (Tina limitation)
  • Files like 2026 (Spring) Study Group Montreal/ crash Tina’s indexer
  • Renaming would break ~40 wikilinks across the vault
  • Solution: match.exclude glob using character classes [(] and [)] (standard glob parentheses cause regex backtracking)
  • tags: [event, tokyo, 2026, intensive] — YAML parses bare 2026 as 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.md
    • 02-areas/educational-programs/events/2026/2026-01-tokyo-intensive/sessions/day-1-session-1.md
  • Tina’s rich-text type can’t parse complex Obsidian markdown (tables with wikilinks, pipe characters)
  • Switched all body fields to string with ui: { component: "textarea" }
  • Trade-off: Tina editor shows raw markdown instead of a WYSIWYG editor, but content is preserved perfectly
  • 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
  • Updated .github/workflows/deploy.yml to 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_ID
    • TINA_TOKEN
    • CLOUDFLARE_API_KEY (pre-existing)
    • CLOUDFLARE_EMAIL (pre-existing)
    • CLOUDFLARE_ACCOUNT_ID (pre-existing)
  • First deploy succeeded (run #22527910907)
  • Added: tina/__generated__/, node_modules/, .env
  • Tina also generates its own .gitignore in site/public/admin/
  • Path: ~/Obsidian/baseworks-kb-shared-brain/.env (not committed)
  • Contains TINA_PUBLIC_CLIENT_ID and TINA_TOKEN
  • Admin panel deployed at kb.baseworks.com/admin/index.html (behind Cloudflare Access)
  • Local dev: cd ~/Obsidian/baseworks-kb-shared-brain && npm run dev starts both Tina + Astro
  • Auto-deploy triggers on every push to master
  • Backup tag: pre-tina-backup at commit 1cf6a7e (pre-Tina state)
FileAction
package.json (root)Created
package-lock.json (root)Created (by npm install)
tina/config.tsCreated
tina/tina-lock.jsonCreated (by tinacms)
.envCreated (local only, not committed)
.gitignoreModified (added Tina entries)
.github/workflows/deploy.ymlModified (added Tina build step)
02-areas/.../2026-01-tokyo-intensive.mdModified (quoted numeric tag)
02-areas/.../day-1-session-1.mdModified (quoted numeric tag)
site/public/admin/index.htmlGenerated (by tinacms, git-ignored)

Two issues prevented the admin panel from loading on the production domain:

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.

  • baseworks-kb.pages.dev/admin/index.html — HTTP 200
  • kb.baseworks.com/admin/index.html — HTTP 200 (behind Cloudflare Access)
  • Admin JS/CSS bundles load correctly (production build, not dev)
  • 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
Terminal window
cd ~/Obsidian/baseworks-kb-shared-brain
git reset --hard pre-tina-backup
git push --force

This restores everything to commit 1cf6a7e (the known-good state before Tina).