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.
/blog-posts
directory/blog-posts
directoryhttps://val-town-blog.pages.dev/rss.xml
/index.tsx
: Main entry point that handles routing and proxying/components/
: React components for rendering the blog
Layout.tsx
: Shared layout component with header and Tailwind setupHomePage.tsx
: Renders the blog homepage with the list of postsBlogPost.tsx
: Renders individual blog posts/utils/blogPosts.ts
: Utilities for fetching, parsing, and caching blog posts/blog-posts/
: Directory containing markdown files for blog postsTo add a new blog post to the Val Town Blog:
/blog-posts
directory with YAML frontmatter:---
title: My New Blog Post
description: A brief description of the post
pubDate: 2025-04-01T00:00:00.000Z
author: Your Name
---
Content of your blog post in markdown format...
/blog/[filename]
(without the .md extension)The blog supports GitHub Flavored Markdown (GFM) with:
When modifying the blog system:
/components
directory/utils/blogPosts.ts
Blog posts are cached in memory to improve performance: