This commit is contained in:
+4
-4
@@ -1,10 +1,9 @@
|
||||
import { defineConfig } from "tinacms";
|
||||
import { UsernamePasswordAuthJSProvider, TinaUserCollection } from "tinacms-authjs/dist/tinacms";
|
||||
|
||||
// Your TinaCMS configuration
|
||||
export default defineConfig({
|
||||
branch: process.env.TINA_BRANCH || "main",
|
||||
clientId: process.env.TINA_CLIENT_ID || "",
|
||||
token: process.env.TINA_TOKEN || "",
|
||||
contentApiUrlOverride: "/api/tina/gql",
|
||||
authProvider: new UsernamePasswordAuthJSProvider(),
|
||||
|
||||
build: {
|
||||
outputFolder: "admin",
|
||||
@@ -19,6 +18,7 @@ export default defineConfig({
|
||||
},
|
||||
schema: {
|
||||
collections: [
|
||||
TinaUserCollection,
|
||||
{
|
||||
name: "post",
|
||||
label: "Blog Posts",
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
import { createDatabase, createLocalDatabase } from '@tinacms/datalayer'
|
||||
import { MongodbLevel } from 'mongodb-level'
|
||||
import { GitHubProvider } from 'tinacms-gitprovider-github'
|
||||
|
||||
const isLocal = process.env.TINA_PUBLIC_IS_LOCAL === 'true'
|
||||
const branch = process.env.GITEA_BRANCH || 'main'
|
||||
|
||||
export default isLocal
|
||||
? createLocalDatabase()
|
||||
: createDatabase({
|
||||
gitProvider: new GitHubProvider({
|
||||
branch,
|
||||
owner: process.env.GITEA_OWNER!,
|
||||
repo: process.env.GITEA_REPO!,
|
||||
token: process.env.GITEA_TOKEN!,
|
||||
octokitOptions: {
|
||||
// Gitea's GitHub-compatible API
|
||||
baseUrl: 'https://git.idealconnected.com/api/v1',
|
||||
},
|
||||
}),
|
||||
databaseAdapter: new MongodbLevel({
|
||||
collectionName: 'tinacms',
|
||||
dbName: 'tinacms',
|
||||
mongoUri: process.env.MONGODB_URI!,
|
||||
}),
|
||||
})
|
||||
Reference in New Issue
Block a user