Public
Like
6
postherous
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data โ all from the browser, and deployed in milliseconds.
Viewing readonly version of main branch: v320View latest version
Your email blog platform is now ready to use! Here's how to get started:
To publish a blog post, simply send an email to your Val Town email address:
- Subject: Becomes the post title
- Body: Becomes the post content (HTML preferred, plain text will be converted)
- From: Becomes the author information
Example email:
To: your-email-val@val.town
Subject: My First Blog Post
Body: <h2>Hello World!</h2><p>This is my first post published via email!</p>
- Main Blog: Visit your backend HTTP val URL
- Individual Posts:
/post/[slug]
(auto-generated from title) - RSS Feed:
/rss
- API:
/api/posts
for JSON data
โ Core Features
- Email-to-publish functionality
- HTML and plain text support
- Automatic slug generation
- SQLite database storage
- RSS 2.0 feed
- Responsive web interface
- SEO-friendly URLs
- Social media meta tags
โ Technical Features
- Static HTML generation (no client-side JavaScript)
- Hono backend API
- TailwindCSS styling
- Error handling and logging
- Fast loading and SEO optimized
The platform includes foundation code for:
- Set
WEBSUB_HUB_URL
environment variable - Endpoint:
/websub
for subscription management - Automatically notifies subscribers of new posts
- Set
BASE_URL
environment variable to your domain - For production use: Generate RSA keys for HTTP signatures
- Visit
/generate-keys.ts
to generate keys - Set
ACTIVITYPUB_PUBLIC_KEY
andACTIVITYPUB_PRIVATE_KEY
environment variables - Restart your val
- Visit
- Actor endpoint:
/actor
- Inbox endpoint:
/inbox
- Full federation support with followers, likes, and shares
- Set
ATPROTO_HANDLE
andATPROTO_PASSWORD
environment variables - Automatically cross-posts to Bluesky when publishing
Optional configuration:
# Base URL for your blog (required for custom domains and ActivityPub) BASE_URL=https://your-domain.com # WebSub Hub URL (e.g., https://pubsubhubbub.appspot.com/) WEBSUB_HUB_URL=your-hub-url # AT Protocol (Bluesky) credentials ATPROTO_HANDLE=your-handle.bsky.social ATPROTO_PASSWORD=your-app-password # ActivityPub HTTP Signatures (recommended for production) ACTIVITYPUB_PUBLIC_KEY=-----BEGIN PUBLIC KEY-----... ACTIVITYPUB_PRIVATE_KEY=-----BEGIN PRIVATE KEY-----...
To generate ActivityPub keys:
- Visit
/generate-keys.ts
in your browser - Copy the generated keys to your environment variables
- Restart your val for changes to take effect
- Edit CSS in the
getCustomCSS()
function in/backend/index.ts
- Uses TailwindCSS classes throughout
- Modify HTML generation functions for layout changes
- Update blog title and description in HTML generation functions
- Change favicon in HTML templates
- Modify footer text in
generateBlogHTML()
andgeneratePostHTML()
- Posts are stored in SQLite table
blog_posts_v1
- To modify schema, create new table name (e.g.,
blog_posts_v2
)
Use the /test-publish.ts
val to create sample posts for testing.
- Check Val Town logs for email processing
- Use
/health
endpoint for status checks - Monitor
/api/posts
for data integrity
Email โ email.ts (Email Trigger)
โ
Database (SQLite)
โ
backend/index.ts (HTTP API + HTML Generation)
โ
Static HTML (TailwindCSS)
- Set up email forwarding to your Val Town email address
- Configure environment variables for federation features
- Customize styling and branding to match your preferences
- Test email publishing with different content types
- Share your RSS feed for syndication
- Check Val Town logs for debugging
- Use the
/health
endpoint to verify system status - Test individual components using the API endpoints
Your email blog platform is ready to use! Send your first email to start publishing.