Skip to main content

Wiki Editor Setup Guide

This guide explains how to set up in-browser editing for your Veritect AI wiki.

What is Decap CMS?

Decap CMS (formerly Netlify CMS) is a git-based CMS that provides a user-friendly interface for editing content stored in GitHub.

Setup Steps

  1. Enable GitHub OAuth

    • Go to GitHub Settings > Developer settings > OAuth Apps
    • Create new OAuth App with:
      • Homepage URL: https://wiki.veritect.ai
      • Callback URL: https://wiki.veritect.ai/admin/
  2. Configure Authentication

    • Use Netlify Identity or self-hosted OAuth server
    • Or use GitHub as OAuth provider directly
  3. Access the CMS

    • Navigate to https://wiki.veritect.ai/admin/index.html
    • Or click "Quick Links > CMS Admin" in the navbar
    • Login with GitHub credentials
    • Create and edit content with live preview

Features

  • ✅ WYSIWYG editor
  • ✅ Live preview
  • ✅ Media uploads
  • ✅ Draft/publish workflow
  • ✅ No coding required

Option 2: Custom Editor Page

We've created a custom editor at /editor with:

  • Markdown editor with preview
  • Frontmatter generation
  • Syntax highlighting
  • Save to GitHub (requires setup)

To Enable GitHub Saving

  1. Create GitHub App

    // Install Octokit
    npm install @octokit/rest
  2. Add API Route (if using Cloudflare Workers)

    export async function onRequestPost({ request, env }) {
    const { content, path, message } = await request.json();

    // Use GitHub API to create/update file
    const octokit = new Octokit({
    auth: env.GITHUB_TOKEN,
    });

    await octokit.repos.createOrUpdateFileContents({
    owner: 'veritect-ai',
    repo: 'wiki',
    path: path,
    message: message,
    content: Buffer.from(content).toString('base64'),
    branch: 'main',
    });

    return new Response('Success', { status: 200 });
    }

Option 3: Third-Party Solutions

GitBook

  • Pros: Full-featured, great UX
  • Cons: Paid for private repos

Prose.io

  • Pros: Free, simple
  • Cons: Limited features

GitHub Web Editor

  • Press . on any GitHub page
  • Opens VS Code in browser
  • Direct editing with preview

Security Considerations

  1. Authentication Required

    • Only authorized users can edit
    • Use GitHub teams for access control
  2. Branch Protection

    • Require PR reviews for main branch
    • Use preview deployments for drafts
  3. Audit Trail

    • All changes tracked in Git
    • Author information preserved

Quick Start

For immediate use:

  1. Use GitHub's Built-in Editor

    • Click "Edit this page" on any wiki page
    • Make changes in GitHub's web editor
    • Commit directly or create PR
  2. Use the Custom Editor

    • Go to /editor on your wiki
    • Create content with preview
    • Copy markdown to GitHub manually
  3. Set up Decap CMS

    • Already configured at /admin/
    • Just needs OAuth setup

Workflow Options

For Non-Technical Users

  1. Use Decap CMS at /admin/
  2. Visual editor with preview
  3. Auto-commits to GitHub

For Technical Users

  1. Use custom editor at /editor
  2. GitHub web editor (press .)
  3. Local development with VS Code

For Reviewers

  1. All changes create PRs
  2. Preview deployments on Cloudflare
  3. Approve and merge

Next Steps

  1. Choose your preferred editor option
  2. Set up GitHub OAuth
  3. Configure user permissions
  4. Train team on chosen workflow

Need help? Contact the dev team on Slack #wiki-help