FeaturesTemplatesShowcaseTownie
AI
BlogDocsPricing
Log inSign up
arfan
arfanmin-md-blog
Public
Like
min-md-blog
Home
Code
10
posts
3
S
App.tsx
S
Layout.tsx
S
Post.tsx
README.md
S
components.tsx
S
config.ts
H
main.tsx
S
routes.ts
S
utils.ts
Branches
6
Pull requests
Remixes
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 miliseconds.
Sign up now
Code
/
Code
/
Search
Open in new tab
README.md

Minimal Markdown Blog

A clean, modern blog built with React, DaisyUI, and Val Town. Features enhanced markdown rendering, theme switching, and responsive design.

Features

  • Modern UI: DaisyUI components with 18 curated themes
  • Enhanced Markdown: Improved rendering with icons, proper indentation, and styling
  • Clickable Post Cards: Entire cards are clickable for better UX
  • Theme Persistence: Automatic theme saving via localStorage
  • HTML in Markdown: Full HTML support within markdown files
  • Responsive Design: Mobile-friendly layout
  • DaisyUI Styling: Consistent design system with Tailwind CSS classes

Recent Improvements

โœ… Markdown Enhancements

  • Removed Math/KaTeX Support: Cleaned up unnecessary dependencies
  • Fixed Table Rendering: Proper table structure with headers, body, and responsive wrapper
  • Added Heading Icons: Each heading level has a unique icon (๐Ÿ“–, ๐Ÿ“, ๐Ÿ“Œ, ๐Ÿ”ธ, โ–ช๏ธ, โ€ข)
  • Fixed List Indentation: Proper ml-6 indentation for nested lists
  • DaisyUI Task Lists: Task list items now show proper DaisyUI checkboxes instead of plain text
  • Enhanced Code Blocks:
    • w-fit sizing for better layout
    • Copy button (๐Ÿ“‹) with hover effects
    • Proper positioning and styling

Markdown Component Features

Headings with Icons

  • H1: ๐Ÿ“– (Book icon)
  • H2: ๐Ÿ“ (Memo icon)
  • H3: ๐Ÿ“Œ (Pushpin icon)
  • H4: ๐Ÿ”ธ (Diamond icon)
  • H5: โ–ช๏ธ (Small square icon)
  • H6: โ€ข (Bullet icon)

Lists

  • Unordered/Ordered Lists: Proper ml-6 indentation for nested items
  • Task Lists: DaisyUI checkbox components with checkbox checkbox-sm classes
  • Support for [ ], [x], and [X] syntax

Code Blocks

  • Inline Code: Styled with bg-base-300 px-2 py-1 rounded
  • Code Blocks:
    • w-fit max-w-full sizing
    • Relative positioning for copy button
    • Copy button with clipboard emoji (๐Ÿ“‹)
    • Hover effects and proper accessibility

Tables

  • Responsive Wrapper: overflow-x-auto container
  • DaisyUI Styling: table table-zebra w-full
  • Proper Structure: thead, tbody, tr, th, td elements
  • Enhanced Headers: bg-base-300 background for distinction

Project Structure

โ”œโ”€โ”€ main.tsx              # HTTP entry point
โ”œโ”€โ”€ routes.ts             # Request routing and page rendering
โ”œโ”€โ”€ config.ts             # Shared configuration and types
โ”œโ”€โ”€ utils.ts              # Utility functions
โ”œโ”€โ”€ components.tsx        # Reusable UI components
โ”œโ”€โ”€ App.tsx               # Homepage component
โ”œโ”€โ”€ Post.tsx              # Enhanced post component with improved markdown
โ”œโ”€โ”€ Layout.tsx            # HTML layout (KaTeX removed)
โ”œโ”€โ”€ posts/                # Markdown blog posts
โ”‚   โ”œโ”€โ”€ test.md          # Comprehensive test file
โ”‚   โ””โ”€โ”€ showcase.md      # Clean showcase of features
โ””โ”€โ”€ README.md

Architecture

Design Principles Applied

  • KISS: Simple, focused components with single responsibilities
  • DRY: Shared configuration, utilities, and reusable components
  • SoC: Clear separation between routing, UI, and utilities
  • YAGNI: Removed unused features (KaTeX) and excessive complexity
  • SRP: Each component has a single, clear purpose

Key Components

Post.tsx - Enhanced markdown rendering

  • Custom markdown components with DaisyUI styling
  • Icon-enhanced headings for better visual hierarchy
  • Proper list indentation and task list checkboxes
  • Code blocks with copy functionality
  • Responsive table rendering
  • Support for remark-gfm (GitHub Flavored Markdown)

Layout.tsx - Cleaned up HTML generation

  • Removed KaTeX dependencies
  • Streamlined CSS and JavaScript loading
  • Maintained theme management functionality

Refactoring Results

Code Improvements

  • Enhanced Markdown: Better visual hierarchy and functionality
  • Removed Dependencies: KaTeX scripts eliminated
  • Better UX: Copy buttons, proper checkboxes, responsive tables
  • Consistent Styling: All elements use DaisyUI classes

Eliminated Issues

  • โŒ Math rendering dependencies (KaTeX)
  • โŒ Broken table rendering
  • โŒ Plain text task lists
  • โŒ Poor list indentation
  • โŒ Basic code blocks without copy functionality

New Features

  • โœ… Heading icons for visual hierarchy
  • โœ… Proper DaisyUI task list checkboxes
  • โœ… Copy buttons on code blocks
  • โœ… Responsive table containers
  • โœ… Enhanced list indentation
  • โœ… GitHub Flavored Markdown support

Usage

  1. Add .md files to posts/ directory
  2. Use standard markdown syntax with GitHub extensions
  3. Task lists with - [ ] and - [x] syntax
  4. Tables with proper header/body structure
  5. Code blocks with automatic copy functionality
  6. Click post cards to view full content
  7. Use theme selector to change appearance

Technical Highlights

  • TypeScript: Full type safety with interfaces
  • React 18: Modern JSX with proper imports
  • DaisyUI: Utility-first CSS framework
  • Enhanced Markdown: react-markdown with remark-gfm
  • Theme System: Persistent theme switching with 18 curated options
  • Responsive Design: Mobile-first approach with Tailwind CSS
  • Accessibility: Proper ARIA labels and semantic HTML

The blog now provides a superior markdown experience with better visual design, enhanced functionality, and cleaner code architecture.

Code
posts
S
App.tsx
S
Layout.tsx
S
Post.tsx
README.md
S
components.tsx
S
config.ts
H
main.tsx
S
routes.ts
S
utils.ts
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.