Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
7dcf0b5
Improve build page UX
buzzkillb Mar 16, 2026
8dda66e
Enable actual build from admin UI
buzzkillb Mar 16, 2026
f189bf9
Fix build workflow
buzzkillb Mar 16, 2026
f92d475
fix: upgrade to Astro 6, fix blog posts, update Tailwind 4
buzzkillb Mar 20, 2026
adc8a3e
fix: address code review issues
buzzkillb Mar 20, 2026
87965b3
fix: update README, wrangler.toml, and apply saved theme CSS
buzzkillb Mar 20, 2026
5e68ced
fix: address code review and expert review issues
buzzkillb Mar 20, 2026
84f048c
fix: critical XSS and duplicate slug validation bugs
buzzkillb Mar 20, 2026
c0eb705
fix: small code quality issues
buzzkillb Mar 20, 2026
fdd285f
fix: correct tech stack docs and wrangler command
buzzkillb Mar 20, 2026
0a8af81
feat: complete StaticPress rebuild with new admin UI
buzzkillb Mar 20, 2026
bbea234
fix: iframe preview dark mode CSS syntax
buzzkillb Mar 20, 2026
5252c0a
security: fix XSS, add auth, improve parsing, add caching
buzzkillb Mar 20, 2026
a2c192f
fix: YAML injection, CSS injection, TipTap sanitization
buzzkillb Mar 20, 2026
bc5f28a
feat: TipTap editor extensions, media management, contact form, and s…
buzzkillb Mar 20, 2026
611550f
security: fix all scan report issues
buzzkillb Mar 20, 2026
dac29ec
security: fix scan report issues - API token, SVG, cache, localhost c…
buzzkillb Mar 20, 2026
11b9495
centralize site config with build-time warnings
buzzkillb Mar 20, 2026
f8e4b04
feat: consolidate site and deploy settings in admin panel
buzzkillb Mar 20, 2026
7ebd9d3
feat: add settings page to admin SPA
buzzkillb Mar 20, 2026
591962e
fix: generate robots.txt from config at build time
buzzkillb Mar 20, 2026
4a1994a
feat: add siteName and author to centralized config system
buzzkillb Mar 20, 2026
7b6be41
fix: use siteUrl from config in dev server sitemap and reject SVG upl…
buzzkillb Mar 20, 2026
0e09464
fix: add published field to pages schema and filter sitemap by it
buzzkillb Mar 20, 2026
b3e8d9c
security: fix multiple vulnerabilities
buzzkillb Mar 20, 2026
6fba64a
security: fix path traversal, YAML parsing, token exposure
buzzkillb Mar 20, 2026
cf91652
security: tighten iframe sandbox and improve isProduction() check
buzzkillb Mar 20, 2026
4f878e4
fix: prevent double HTML-escaping when switching from visual to markd…
buzzkillb Mar 20, 2026
2d655a2
fix: strict CSS injection protection with property whitelist and safe…
buzzkillb Mar 20, 2026
61e8584
fix: update theme code editor default CSS to only use whitelisted pro…
buzzkillb Mar 20, 2026
d996db9
fix: XML escape slugs in sitemap generation to prevent XSS injection
buzzkillb Mar 20, 2026
960f88e
fix: escape siteUrl in sitemap XML and use JSON_SCHEMA for YAML
buzzkillb Mar 20, 2026
c095345
fix: sanitize shell metacharacters in deploy command
buzzkillb Mar 20, 2026
8e991e8
fix: escape --- sequences in content to prevent frontmatter corruption
buzzkillb Mar 20, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
114 changes: 109 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,119 @@
# blog-static
# StaticPress

To install dependencies:
A local-first static site generator with a WordPress-like admin panel. Create blogs, landing pages, and business websites that deploy to Cloudflare Pages for fast, secure, free hosting.

## Features

- **Visual Editor** - WYSIWYG editing with TipTap
- **Markdown Support** - Toggle to raw markdown for power users
- **Live Preview** - See changes in real-time (split view, iframe, or rendered HTML)
- **SEO Optimized** - Sitemap, robots.txt, Open Graph, and Twitter cards built-in
- **Cloudflare Ready** - One-click deploy to Cloudflare Pages
- **Dark Mode** - Built-in dark mode support
- **Fast Static Files** - Pure HTML/CSS, no JavaScript required for visitors

## Requirements

- [Bun](https://bun.sh) - Runtime
- [Wrangler](https://developers.cloudflare.com/workers/wrangler/) - For Cloudflare deployment

## Quick Start

```bash
# Install dependencies
bun install

# Start the dev server
bun run dev

# Open admin panel
open http://localhost:4321/admin/
```

To run:
## Workflow

1. **Create Content** - Go to `/admin/` to create posts and pages
2. **Edit** - Use visual mode or markdown toggle
3. **Preview** - See live preview as you edit
4. **Save** - Saves markdown files to `src/content/posts/` or `src/content/pages/`
5. **Build** - Click "Build Site" or run `bun run build`
6. **Deploy** - Click "Deploy" to push to Cloudflare Pages

## Project Structure

```
├── src/
│ ├── content/
│ │ ├── posts/ # Blog posts (markdown)
│ │ └── pages/ # Static pages (markdown)
│ ├── pages/
│ │ ├── blog/ # Blog post routes
│ │ ├── [slug].astro # Static page routes
│ │ └── index.astro # Homepage
│ ├── layouts/ # Shared layouts
│ ├── lib/ # Utilities
│ └── server.ts # Dev server
├── admin/
│ └── index.html # Admin SPA
├── dist/ # Built output
└── public/ # Static assets
```

## Configuration

### Site URL

Before deploying, update the site URL in:
- `src/pages/index.astro`
- `src/pages/blog/index.astro`
- `src/pages/blog/[slug].astro`
- `src/pages/[slug].astro`

Replace `https://yoursite.com` with your actual domain.

### Cloudflare Setup

1. Create a Cloudflare Pages project
2. Go to `/admin/deploy` in the admin panel
3. Enter your:
- Project Name
- API Token (needs "Cloudflare Pages: Edit" permission)
- Account ID

## SEO

StaticPress includes:

- **Sitemap** - Auto-generated at `/sitemap.xml`
- **Robots.txt** - Configured at `/robots.txt`
- **Meta Tags** - Title, description, canonical URLs
- **Open Graph** - Social sharing cards
- **Twitter Cards** - Twitter metadata

## Commands

```bash
bun run index.ts
bun run dev # Start dev server (serves admin + builds on save)
bun run build # Build static site to dist/
bun run preview # Preview built site locally
bun run deploy # Deploy to Cloudflare Pages
```

This project was created using `bun init` in bun v1.3.9. [Bun](https://bun.com) is a fast all-in-one JavaScript runtime.
## Tech Stack

- **Astro** - Static site generator
- **TipTap** - Rich text editor
- **Tailwind CSS** - Styling
- **Bun** - Runtime and dev server
- **Cloudflare Pages** - Hosting

## Security

- Admin panel is never deployed (not in `dist/`)
- API routes are never deployed
- Only static HTML/CSS/JS goes to Cloudflare Pages
- robots.txt blocks crawlers from admin/API

## License

MIT
104 changes: 104 additions & 0 deletions admin/admin-editor.js

Large diffs are not rendered by default.

Loading