Sveltia CMS Setup Guide for Matt Blogs IT
Sveltia CMS Setup Guide for Matt Blogs IT
This guide walks you through setting up Sveltia CMS with authentication for your Jekyll blog. Choose one of two methods based on your needs.
Quick Start: Which Authentication Method?
| Factor | OAuth (Cloudflare) | Personal Access Token (PAT) |
|---|---|---|
| Setup Time | 15 minutes | 5 minutes |
| Cost | FREE (no credit card) | FREE |
| User Experience | Click “Login with GitHub” | Paste token manually |
| Best For | Multiple editors | Solo developer |
| Recommendation | ✅ Recommended | Alternative |
Both methods are 100% free forever. Choose based on your preference.
Method 1: OAuth with Cloudflare Workers (Recommended)
Overview
Cloudflare Workers provides a free, serverless OAuth proxy that enables one-click “Login with GitHub” authentication.
Free Tier Limits:
- 100,000 requests/day (OAuth only uses ~5-20/day for your blog)
- No credit card required
- Commercial use allowed
- Perfect for personal blogs
Step 1: Create GitHub OAuth Application
- Go to GitHub Developer Settings:
- Navigate to: https://github.com/settings/developers
- Click “OAuth Apps” → “New OAuth App”
- Fill in application details:
1 2 3
Application name: Matt Blogs IT CMS Homepage URL: https://mattblogsit.com Authorization callback URL: https://YOUR-WORKER-NAME.workers.dev/callback
⚠️ Note: You’ll update the callback URL after deploying your Cloudflare Worker in Step 2.
- Save Client ID and Client Secret:
- After creating, copy both values
- You’ll need these for Cloudflare Worker configuration
Step 2: Deploy Sveltia CMS OAuth Worker to Cloudflare
Option A: Deploy with Sveltia’s Pre-Built Worker (Easiest)
- Create Cloudflare account:
- Go to: https://dash.cloudflare.com/sign-up
- Sign up (no credit card required)
- Deploy the OAuth worker:
- Go to: https://github.com/sveltia/sveltia-cms-auth
- Click “Deploy to Cloudflare Workers” button
- Follow the one-click deployment
- Configure environment variables:
- In Cloudflare Workers dashboard, find your deployed worker
- Go to Settings → Variables
- Add these secrets:
1 2
GITHUB_CLIENT_ID=<your_github_client_id> GITHUB_CLIENT_SECRET=<your_github_client_secret>
- Get your Worker URL:
- Your worker URL will be:
1
https://YOUR-WORKER-NAME.workers.dev
- Copy this URL for the next step
- Your worker URL will be:
Option B: Deploy Manually (Advanced)
If you prefer to deploy manually using Wrangler CLI:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# Install Wrangler
npm install -g wrangler
# Clone the OAuth worker repository
git clone https://github.com/sveltia/sveltia-cms-auth.git
cd sveltia-cms-auth
# Login to Cloudflare
wrangler login
# Add secrets
wrangler secret put GITHUB_CLIENT_ID
# Paste your GitHub Client ID
wrangler secret put GITHUB_CLIENT_SECRET
# Paste your GitHub Client Secret
# Deploy
wrangler deploy
Step 3: Update GitHub OAuth Application
- Go back to GitHub OAuth App settings:
- https://github.com/settings/developers
- Select your “Matt Blogs IT CMS” OAuth app
- Update Authorization callback URL:
1
https://YOUR-WORKER-NAME.workers.dev/callback
- Save changes
Step 4: Update CMS Configuration
- Edit
:1
admin/config.yml
- Find the
section1
backend
- Uncomment and update the
line:1
base_url
1 2 3 4 5
backend: name: github repo: MattBlogsIT/mattblogsit-blog branch: main base_url: https://YOUR-WORKER-NAME.workers.dev # Add your worker URL
- Find the
- Commit and push:
1 2 3
git add admin/config.yml git commit -m "Configure Sveltia CMS OAuth with Cloudflare Workers" git push origin main
Step 5: Test Authentication
-
Wait for GitHub Pages to rebuild (2-3 minutes)
- Access the CMS:
- Go to: https://mattblogsit.com/admin
- You should see the Sveltia CMS login screen
- Click “Login with GitHub”:
- You’ll be redirected to GitHub
- Authorize the application
- You’ll be redirected back to the CMS
- Success! You’re now logged in
- Test creating a post:
- Click “New Blog Post”
- Fill in the fields
- Click “Save”
- This will commit directly to your GitHub repository
- Your CI/CD pipeline will automatically build and deploy
Method 2: Personal Access Token (PAT) Authentication
Overview
PAT authentication lets you authenticate with GitHub using a personal access token instead of OAuth. This is simpler but requires manually managing tokens.
Step 1: Create GitHub Personal Access Token
- Go to GitHub Token Settings:
- Navigate to: https://github.com/settings/tokens?type=beta
- Click “Generate new token” → “Fine-grained token”
- Configure token:
1 2 3 4 5 6 7 8 9
Token name: Matt Blogs IT CMS Expiration: 90 days (or custom) Repository access: Only select repositories → Select: MattBlogsIT/mattblogsit-blog Permissions: Repository permissions: ✅ Contents: Read and write ✅ Metadata: Read-only (automatic) - Generate token and copy it:
- Click “Generate token”
- IMPORTANT: Copy the token immediately (you won’t see it again)
- Store it securely (password manager recommended)
Step 2: Configure CMS for PAT
- Edit
:1
admin/config.yml
- Make sure the
line is commented out or removed:1
base_url
1 2 3 4 5
backend: name: github repo: MattBlogsIT/mattblogsit-blog branch: main # base_url is NOT set for PAT authentication
- Make sure the
- Commit and push:
1 2 3
git add admin/config.yml git commit -m "Configure Sveltia CMS for PAT authentication" git push origin main
Step 3: Login with PAT
-
Wait for GitHub Pages to rebuild (2-3 minutes)
- Access the CMS:
- Go to: https://mattblogsit.com/admin
- Authenticate with PAT:
- You’ll see “Authenticate with GitHub” button
- Click it
- You may see an option for “Use Personal Access Token”
- Paste your PAT token
- The CMS will store it in your browser’s local storage
- Test creating a post:
- Click “New Blog Post”
- Fill in the fields
- Click “Save”
- This will commit directly to GitHub using your PAT
Step 4: Token Renewal
Important: PATs expire based on your configuration (default 90 days).
Before token expires:
- Create a new PAT with the same permissions
- Go to https://mattblogsit.com/admin
- Logout (if available) or clear browser storage
- Login again with the new PAT
Using the CMS
Once authenticated (either method), you can:
Create a New Blog Post
- Click “Blog Posts” in the sidebar
- Click “New Blog Post” button
- Fill in the required fields:
- Title: Post title
- Publication Date: Auto-filled with today
- Categories: Select 1-3 categories (dropdown)
- Excerpt: 50-200 characters for SEO
- Tags: Optional, lowercase-with-hyphens
- Body: Write your content in Markdown
- Upload images:
- Click image icon in the toolbar
- Drag and drop images
- Images are uploaded to
1
assets/img/
- Note: CI/CD will automatically optimize images >500KB
- Preview your post:
- Click the “Preview” tab
- See rendered markdown (not styled like your site)
- Save the post:
- Click “Save” button
- Sveltia commits to GitHub automatically
- GitHub Actions triggers build and deployment
- Post goes live in 2-3 minutes
Edit Existing Posts
- Click “Blog Posts” in sidebar
- Browse or search for your post
- Click the post to open it
- Make changes
- Click “Save”
- Changes are committed to GitHub
Manage Images
- Images are uploaded to
1
assets/img/
- Click “Media” in sidebar to browse all images
- Drag and drop new images
- Delete unused images
Advanced Configuration
Enable Draft Workflow
To enable draft/publish workflow:
- Edit
:1
admin/config.yml
1 2
# Uncomment this line: publish_mode: editorial_workflow
- How it works:
- Drafts are saved as PRs
- Click “Set Status” → “Ready” → “Publish”
- Merges PR to main branch
Local Development
Test CMS locally without authentication:
- Edit
:1
admin/config.yml
1 2
# Add at the bottom: local_backend: true
- Start local backend:
1
npx @sveltia/cms-proxy
- Start Jekyll:
1
bundle exec jekyll serve --baseurl ""
- Access CMS:
- Go to: http://127.0.0.1:4000/admin
- No authentication required locally
Troubleshooting
OAuth Issues
Problem: “Failed to authenticate with GitHub”
Solutions:
- Check Cloudflare Worker is running: Visit
(should return “OK” or similar)1
https://YOUR-WORKER.workers.dev
- Verify GitHub OAuth callback URL matches Worker URL exactly
- Check Cloudflare Worker environment variables are set correctly
- Verify GitHub OAuth app is not suspended
Problem: “Redirect URI mismatch”
Solution: GitHub callback URL must be: (exact match)1
https://YOUR-WORKER.workers.dev/callback
PAT Issues
Problem: “Token invalid or expired”
Solutions:
- Generate new PAT with correct permissions (Contents: Read and write)
- Ensure PAT hasn’t expired
- Clear browser local storage and re-authenticate
Problem: “Not authorized to access repository”
Solution: PAT must have “Contents: Read and write” permission for your repository
General Issues
Problem: CMS page is blank
Solutions:
- Check browser console for errors (F12)
- Ensure
has valid YAML syntax1
admin/config.yml
- Verify
loads Sveltia CMS from CDN1
admin/index.html
Problem: “Config file not found”
Solution: Ensure exists and is accessible at 1
admin/config.yml
1
/admin/config.yml
Problem: Changes not appearing on site
Solution:
- Check GitHub Actions is running (may take 2-3 minutes)
- Verify commit was made to
branch1
main
- Check GitHub Pages deployment status
Security Best Practices
- Never commit OAuth secrets or PATs to Git
- OAuth secrets stay in Cloudflare Workers
- PATs stay in browser local storage only
- Use fine-grained PATs with minimal permissions
- Only grant access to your blog repository
- Set reasonable expiration dates
- Rotate tokens regularly
- Update OAuth secrets annually
- Renew PATs every 90 days
- Monitor access
- Check GitHub repository settings → “OAuth applications” regularly
- Revoke access for unused applications
- HTTPS only
- Always access CMS via
1
https://mattblogsit.com/admin
- Never use HTTP for authentication
- Always access CMS via
Cost Summary
| Component | Cost |
|---|---|
| Sveltia CMS | $0 (open source) |
| Cloudflare Workers | $0 (free tier: 100K requests/day) |
| GitHub Pages | $0 (free for public repos) |
| GitHub OAuth | $0 (free) |
| GitHub API | $0 (5,000 requests/hour free) |
| Total | $0/month |
No credit card required for any service.
Support & Resources
- Sveltia CMS Documentation: https://github.com/sveltia/sveltia-cms
- Sveltia CMS Auth: https://github.com/sveltia/sveltia-cms-auth
- GitHub OAuth Docs: https://docs.github.com/en/apps/oauth-apps
- Cloudflare Workers Docs: https://developers.cloudflare.com/workers/
Next Steps
After completing setup:
- ✅ Test creating a blog post
- ✅ Test image uploads
- ✅ Verify post appears on live site
- ✅ Update CLAUDE.md with CMS instructions for future contributors
- ✅ (Optional) Enable editorial workflow for drafts
Congratulations! Your CMS is ready to use. 🎉