Content Outside the App Folder
Introduction
In some projects, your content files live outside the application folder where TinaCMS is installed. For example, your Next.js app might be in packages/website/ while your markdown content is in a top-level content/ folder.
TinaCMS supports this layout using the localContentPath config option. This guide walks through how to set it up.
If your content lives in a completely separate Git repository, see the Separate Content Repo guide instead.
Example Structure
my-monorepo/āāā content/ ā your markdown/MDX contentā āāā tina/ ā required (TinaCMS writes generated files here)ā āāā pages/ā ā āāā home.mdxā āāā posts/ā āāā hello.mdāāā packages/āāā website/ ā your Next.js appāāā tina/ā āāā config.ts ā TinaCMS config lives hereāāā package.jsonāāā ...
Step 1: Configure localContentPath
In your tina/config.ts, set localContentPath to point at your content directory. The path is resolved relative to the tina/ config folder, not the project root.
// packages/website/tina/config.tsimport { defineConfig } from 'tinacms'export default defineConfig({// From packages/website/tina/ ā up 3 levels ā into content/localContentPath: process.env.TINA_CONTENT_PATH || '../../../content',build: {publicFolder: 'public',outputFolder: 'admin',},schema: {collections: [{name: 'post',label: 'Blog Posts',path: 'posts', // relative to content root, NOT the appfields: [{type: 'string',name: 'title',label: 'Title',},{type: 'rich-text',name: 'body',label: 'Body',isBody: true,},],},],},})
Use an environment variable for
localContentPathsince the relative path may differ per developer depending on where they clone the repo.
Step 2: Create a tina/ Folder in the Content Directory
TinaCMS writes generated files (tina-lock.json, __generated__/ etc.) into a tina/ folder inside the content root. This folder must exist or the CLI will fail with:
Unable to find Tina folder, if you're working in folder outside of the Tina config be sure to specify --rootPath
Create it:
mkdir -p content/tina
You can add a .gitkeep file to ensure it's tracked by Git:
touch content/tina/.gitkeep
Step 3: Set Collection Paths Relative to the Content Root
When localContentPath is set, collection path values are resolved relative to the content root ā not the application folder.
For example, if your content lives at content/posts/:
// Correct - relative to content root{name: 'post',path: 'posts',// ...}// Wrong - would look for content/content/posts/{name: 'post',path: 'content/posts',// ...}
Step 4: Run the Dev Server
No special CLI flags are needed. Just run from your app directory as usual:
cd packages/websitenpx tinacms dev -c "next dev"
You should see:
š¦ TinaCMS Dev Server is initializing...Using separate content repo at /path/to/my-monorepo/contentTinaCMS Dev Server is active
Troubleshooting
"Unable to find Tina folder ... specify --rootPath"
This error means the content directory is missing a tina/ folder. Create one with mkdir content/tina. The --rootPath suggestion in the error message is misleading for this use case ā it controls where TinaCMS looks for the app config, not the content directory.
Documents not found or empty collections
Check that your collection path values are relative to the content root, not the app folder. If localContentPath points to content/, then path: "posts" resolves to content/posts/, not content/content/posts/.
Path resolution reference
localContentPath is resolved relative to the tina/ config folder. Count the directory levels carefully:
packages/website/tina/config.tsā ā āā ā āāā the fileā āāā localContentPath resolves from hereāāā ../../../content goes: tina/ ā website/ ā packages/ ā repo root ā content/