Headless CMS Without a PC on GitHub Pages
Headless CMS Without a PC on GitHub Pages
I’ve been running my site on GitHub Pages - no server, just git and GitHub Actions. But I still want a CMS that works on mobile, without dragging around a laptop or doing a Git clone. Enter Sveltia CMS + Sveltia CMS Auth on Cloudflare Workers. Here’s how to glue it together.
Why This Setup?
- No paid services like Netlify.
- I edit blog posts from my phone-even waiting in line for coffee.
- No git install, no desktop.
A solution exists: Sveltia’s Cloudflare Workers-based authenticator makes GitHub-backed CMS possible on GitHub Pages.
🎯 Step 1: Add Sveltia CMS to Your Site
In your /admin/index.html, include Sveltia, a lightweight, modern CMS:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="robots" content="noindex" />
<title>Content Manager</title>
</head>
<body>
<script src="https://unpkg.com/@sveltia/cms/dist/sveltia-cms.js"></script>
</body>
</html>
No heavy JS, no React-just Svelte. Touch support, dark mode, fast. It handles GitHub directly via your browser or the auth worker.
🔐 Step 2: Deploy the Sveltia-CMS-Auth Worker
- Fork or import sveltia-cms-auth into Cloudflare Workers.
- Deploy it; grab the Worker URL.
- Register a GitHub OAuth App, using the Worker URL plus /callback for the redirect.
- Add client credentials and your domain to Workers environment variables. Deploy again.
Now your site has its own auth client-it communicates with GitHub when you click Login.
🛠 Step 3: Wire It All Up in Your Config
In your Sveltia admin/config.yml, under backend:
backend:
name: github
repo: <OWNER>/<REPO> # Path to your GitHub repository
# optional, defaults to master
branch: main
base_url: https://<WORKER>.workers.dev
# This line should *not* be indented
media_folder: "assets/uploads" # Media files will be stored in the repo under images/uploads
That base_url points Sveltia’s OAuth to your Worker. Push the change, and your /admin/ loads Sveltia. Clicking “Login” redirects to GitHub via your Worker, and you’re ready to edit.
📱 Step 4: Edit From Your Phone
Visit yourgithubpages.com/admin/ on your mobile device. The UI is responsive and built for touch. I’ve easily edited blog posts without needing VS Code or Terminal. Sveltia handles commit and push transparently.
Quick FAQ
Q: Why not Decap CMS or Netlify CMS?
A: They typically rely on external OAuth providers. Sveltia + Cloudflare Workers solves that neatly.
Q: Does it require a PC?
A: Only initial setup needs a desktop. Afterward, your CMS runs entirely in-browser, even mobile.
Q: Self-hosted?
A: GitHub Pages hosts the static site. The CMS runs client-side, and auth is on Cloudflare’s free tier.
TL;DR
Goal | Tool |
---|---|
GitHub-only hosting | GitHub Pages (no server) |
Modern, touch-ready UI | Sveltia CMS |
OAuth via GitHub | Sveltia-CMS-Auth Worker |
Zero laptop edits | Fully mobile browser-compatible |
This combo gives me a mobile-friendly CMS experience without extra hassle. If you’re editing your Jekyll-based GitHub Pages blog without a PC, this setup hits the mark.
Related Resources
- GitHub Pages Documentation
- Jekyll Documentation
- Cloudflare Workers Documentation
- Setting up Custom Domains with GitHub Pages
- Managing Multiple Domains with Cloudflare
- Sveltia CMS GitHub Repository
- Sveltia CMS Auth GitHub Repository
- My Previous Post on Migrating to GitHub Pages
- My Guide to Multiple Domains on GitHub Pages