FeaturesTemplatesShowcaseTownie
AI
BlogDocsPricing
Log inSign up
paulkinlan
paulkinlanpostherous
https://posthero.us - an email powered blogging system
Public
Like
6
postherous
Home
Code
12
backend
3
frontend
1
shared
2
ACTIVITYPUB.md
README.md
SECURITY.md
SETUP.md
H
debug-config.ts
E
email.ts
H
test-activitypub-inbox.ts
H
test-activitypub.ts
H
test-publish.ts
Branches
1
Pull requests
Remixes
4
History
Environment variables
9
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.
Sign up now
Code
/
SETUP.md
Code
/
SETUP.md
Search
7/10/2025
Viewing readonly version of main branch: v130
View latest version
SETUP.md

Email Blog Platform Setup Guide

Quick Start

Your email blog platform is now ready to use! Here's how to get started:

1. Email Publishing

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>

2. Accessing Your Blog

  • 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

3. Current Features

โœ… 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

4. Federation & Syndication Setup

The platform includes foundation code for:

WebSub (PubSubHubbub)

  • Set WEBSUB_HUB_URL environment variable
  • Endpoint: /websub for subscription management
  • Automatically notifies subscribers of new posts

ActivityPub (Mastodon, etc.)

  • Set ACTIVITYPUB_DOMAIN environment variable
  • Actor endpoint: /actor
  • Inbox endpoint: /inbox
  • Note: Requires additional setup for full federation

AT Protocol (Bluesky)

  • Set ATPROTO_HANDLE and ATPROTO_PASSWORD environment variables
  • Automatically cross-posts to Bluesky when publishing

5. Environment Variables

Optional configuration:

# WebSub Hub URL (e.g., https://pubsubhubbub.appspot.com/) WEBSUB_HUB_URL=your-hub-url # ActivityPub domain for federation ACTIVITYPUB_DOMAIN=your-domain.com # AT Protocol (Bluesky) credentials ATPROTO_HANDLE=your-handle.bsky.social ATPROTO_PASSWORD=your-app-password

6. Customization

Styling

  • Edit CSS in the getCustomCSS() function in /backend/index.ts
  • Uses TailwindCSS classes throughout
  • Modify HTML generation functions for layout changes

Branding

  • Update blog title and description in HTML generation functions
  • Change favicon in HTML templates
  • Modify footer text in generateBlogHTML() and generatePostHTML()

Database Schema

  • Posts are stored in SQLite table blog_posts_v1
  • To modify schema, create new table name (e.g., blog_posts_v2)

7. Testing

Use the /test-publish.ts val to create sample posts for testing.

8. Monitoring

  • Check Val Town logs for email processing
  • Use /health endpoint for status checks
  • Monitor /api/posts for data integrity

Architecture Overview

Email โ†’ email.ts (Email Trigger)
         โ†“
    Database (SQLite)
         โ†“
    backend/index.ts (HTTP API + HTML Generation)
         โ†“
    Static HTML (TailwindCSS)

Next Steps

  1. Set up email forwarding to your Val Town email address
  2. Configure environment variables for federation features
  3. Customize styling and branding to match your preferences
  4. Test email publishing with different content types
  5. Share your RSS feed for syndication

Support

  • 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.

Go to top
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Product
FeaturesPricing
Developers
DocsStatusAPI ExamplesNPM Package Examples
Explore
ShowcaseTemplatesNewest ValsTrending ValsNewsletter
Company
AboutBlogCareersBrandhi@val.town
Terms of usePrivacy policyAbuse contact
ยฉ 2025 Val Town, Inc.