https://github.com/doedja/literal-blog
Minimal Astro blog with Sveltia CMS, one-click Cloudflare Pages deploy.
https://github.com/doedja/literal-blog
Last synced: 28 days ago
JSON representation
Minimal Astro blog with Sveltia CMS, one-click Cloudflare Pages deploy.
- Host: GitHub
- URL: https://github.com/doedja/literal-blog
- Owner: doedja
- License: mit
- Created: 2026-04-21T11:14:09.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2026-04-21T13:05:32.000Z (2 months ago)
- Last Synced: 2026-04-21T14:39:10.745Z (2 months ago)
- Language: Astro
- Homepage:
- Size: 72.3 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# literal-blog
Minimal Astro blog with a built-in CMS at `/admin`, deployable to Cloudflare in one click.
> This is the theme powering **[doedja.com](https://doedja.com)**. The private blog is kept in a separate repo; this is the stripped, generic version.
- Markdown posts in `src/content/posts/{category}/*.md`
- Pages in `src/content/pages/*.md`
- Sveltia CMS at `/admin`, logs in with GitHub, commits to your repo
- Runs as a single Cloudflare Worker with static assets — no separate worker for OAuth
## Deploy
[](https://deploy.workers.cloudflare.com/?url=https://github.com/doedja/literal-blog)
If you fork under a different username, update the button URL in your README to match.
### Setup
1. **Fork and deploy.** Click the button above. Cloudflare forks this repo to your GitHub and creates a Worker project. The first build runs `bun run build` automatically.
2. **Register a GitHub OAuth app** at https://github.com/settings/developers → **New OAuth App**:
- Homepage URL: `https://`
- Authorization callback URL: `https:///api/auth/callback`
Copy the Client ID. Generate a client secret and copy that too.
3. **Add environment variables** in Cloudflare → your Worker → Settings → Variables and Secrets:
| Name | Value | Type |
|---|---|---|
| `GITHUB_REPO` | `your-username/your-fork` | plaintext |
| `GITHUB_BRANCH` | `main` (optional) | plaintext |
| `GITHUB_CLIENT_ID` | from step 2 | secret |
| `GITHUB_CLIENT_SECRET` | from step 2 | secret |
4. **Redeploy** (Deployments tab → latest → Retry). Then visit `/admin` and log in with GitHub.
## Local development
```bash
bun install
bun run dev # Astro dev server (no worker routes)
bun run dev:worker # Full worker + assets via wrangler
```
For `/admin` to work locally you also need a `.dev.vars` file with the env vars. See `.env.example`.
Edit posts in `src/content/posts/`, pages in `src/content/pages/`. Push to trigger a rebuild.
## Customize
- **Site metadata**: `site.config.ts`
- **Navigation**: `src/layouts/Base.astro`
- **Styles**: `src/styles/global.css`
- **Post template**: `src/layouts/Post.astro`
- **CMS collections**: `src/api/admin-config.ts` — add fields or new categories here
## Add a category
1. Create `src/content/posts//` and drop markdown files in.
2. Add a matching collection entry in `src/api/admin-config.ts`.
3. Push. The home page, archive, and RSS pick it up automatically.
## License
MIT