FeaturesTemplatesShowcaseTownie
AI
BlogDocsPricing
Log inSign up
stevekrouse

stevekrouse

original-vt-blog

Val Town Blog, hosted on Val Town
Public
Like
original-vt-blog
Home
Code
4
blog-posts
1
components
1
utils
1
README.md
Branches
1
Pull requests
Remixes
1
History
Environment variables
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
/
README.md
Code
/
README.md
Search
4/2/2025
Viewing readonly version of main branch: v37
View latest version
README.md

Val Town Blog

Overview

The Val Town Blog has undergone a migration from its original hosting on Astro and Cloudflare Pages to being hosted directly on Val Town. This repository contains the code that powers the current blog implementation.

How It Works

Blog Architecture

  • New Posts: New blog posts are rendered directly from Val Town using markdown files
  • Legacy Posts: For older blog posts, we proxy requests to the original blog hosted at Cloudflare Pages
  • Homepage: The homepage is dynamically constructed by:
    1. Parsing the RSS feed from the old blog at https://val-town-blog.pages.dev/rss.xml
    2. Injecting new posts hosted on Val Town into the feed
    3. Rendering the combined content with a consistent design

Components Structure

  • /index.tsx: Main entry point that handles routing and proxying
  • /components/HomePage.tsx: Renders the blog homepage with the list of posts
  • /components/BlogPostTemplate.tsx: Template for rendering individual blog posts
  • /components/BlogPosts.ts: Manages the list of new blog posts and merging with RSS feed
  • /components/MarkdownRenderer.ts: Simple utility to convert markdown to HTML
  • /blog-posts/: Directory containing markdown files for new blog posts

Proxy Mechanism

The main index.tsx file handles proxying requests to the old blog when necessary. When a user visits a URL that corresponds to an old blog post, the request is forwarded to the original Cloudflare Pages deployment.

Adding New Blog Posts

To add a new blog post to the Val Town Blog:

  1. Create a markdown file in the /blog-posts directory with the post content

    • Example: /blog-posts/my-new-post.md
  2. Add the post metadata to the newBlogPosts array in /components/BlogPosts.ts:

    { title: "My New Blog Post", link: "/blog/my-new-post", description: "A brief description of the post", pubDate: "Fri, 29 Mar 2025 00:00:00 GMT", author: "Author Name" }
  3. The post will automatically appear on the homepage and be accessible at the specified link

Technical Details

  • The old blog URL is: https://val-town-blog.pages.dev/
  • New blog posts are stored as markdown files and rendered on-demand
  • The homepage fetches and parses the RSS feed from the old blog
  • The system uses React for rendering both the homepage and individual blog posts
  • No external dependencies are required for markdown parsing or RSS handling

Development

When modifying the blog system:

  1. Update the components in the /components directory
  2. Test changes by visiting the homepage and individual blog posts
  3. For styling changes, modify the inline CSS in the respective component files
  4. To change how posts are fetched or merged, update the fetchBlogPosts function in HomePage.tsx
FeaturesVersion controlCode intelligenceCLI
Use cases
TeamsAI agentsSlackGTM
ExploreDocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareersBrandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.