A modern, fast, and lightweight blog engine built with SvelteKit 5, Tailwind CSS 4, and TypeScript. Features multilingual support, dark/light themes, traffic economy mode, and elegant Markdown rendering.
- Modern Stack: SvelteKit 5 with TypeScript and Tailwind CSS 4
- Multilingual: Support for English, Russian, and Ukrainian
- Theme System: Dark/light themes with separate code block themes
- Traffic Economy: Optimized image loading with WebP compression
- Markdown-First: Enhanced Markdown with custom syntax extensions
- Responsive Design: Mobile-first responsive layout
- Image Modal: Full-screen image viewing with keyboard navigation
- Static Generation: Optimized for deployment as static site
- Docker Ready: Containerized deployment with Nginx
βββ src/
β βββ lib/
β β βββ components/ # Reusable UI components
β β βββ i18n/ # Internationalization files
β β βββ partials/ # Layout components
β β βββ utils/ # Utility functions
β β βββ types.ts # TypeScript type definitions
β βββ routes/ # SvelteKit pages and layouts
β βββ app.html # Main HTML template
βββ static/
β βββ files/ # Blog content structure
β βββ posts.yaml # Generated content tree
βββ scripts/ # Build and utility scripts
βββ docker-compose.yaml # Docker configuration
βββ Dockerfile # Container build instructions- Bun (recommended) or Node.js 18+
- Docker (for containerized deployment)
- Clone and install dependencies:
git clone <repository>
cd mdBlog
bun install- Start development server:
bun dev- Access the application:
- Development:
http://localhost:5173 - Production preview:
bun run preview
- Development:
# Full production build with optimizations
bun bake
# Or step by step:
bun posts # Generate content tree
bun compress:images # Optimize images
bun build # Build static site
bun compress:text # Compress assetsContent is organized in the static/files/ directory with the following structure:
static/files/
βββ index.yaml # Root configuration
βββ category1/
β βββ index.yaml # Category metadata
β βββ +post.en.md # English post content
β βββ +post.ru.md # Russian post content
β βββ +images/ # Original images
β βββ +imagesCompressed/ # Auto-generated WebP images
β βββ subcategory/
β βββ index.yaml
β βββ +post.default.mdEach directory can contain an index.yaml file with metadata:
title:
en: Category Title
ru: ΠΠ°Π·Π²Π°Π½ΠΈΠ΅ ΠΊΠ°ΡΠ΅Π³ΠΎΡΠΈΠΈ
ua: ΠΠ°Π·Π²Π° ΠΊΠ°ΡΠ΅Π³ΠΎΡΡΡ
post: # Available languages for post
- en
- ru
- default
date: 2025-01-01Post files follow the naming convention +post.[language].md:
+post.en.md- English content+post.ru.md- Russian content+post.default.md- Fallback content
The blog supports standard Markdown plus custom extensions:
:::2
Left column
Right column
:::Nested spans β :::cN spans N columns, :::rN spans N rows:
:::3
:::c2
Wide cell spanning 2 columns
:::
Single column cell
:::r2
Wide cell spanning 2 rows
:::
::: # standard
 # span 2 columns
 # span 2 rows@[Title](https://example.com){some-class}
@[Video](https://youtube.com/embed/id){aspect-video w-full}||hidden text||Rendered as a 2-column grid:
Term
: DefinitionThe application supports multiple theme combinations:
- UI Theme: Light/Dark mode for interface
- Language: English/Russian/Ukrainian interface
Custom Tailwind classes and safelist are defined in tailwind.config.ts. The project uses Tailwind CSS 4 with:
- Custom color palette (amber/gray based)
- Responsive grid system
- Typography utilities
- Animation classes
- Create new translation file in
src/lib/i18n/[lang].ts - Add language to
src/lib/constants.ts - Update type definitions in
src/lib/types.ts - Run locale validation:
bun run check:18n
Build and run with Docker Compose:
docker-compose up --build --force-recreateThe application will be available at http://localhost:5173
For CapRover deployment:
bun caprover:build # Build and package
# Upload blog.tar.gz to CapRoverAfter running bun bake, deploy the build/ directory to any static hosting service:
- Netlify
- Vercel
- GitHub Pages
- AWS S3 + CloudFront
bun dev- Start development serverbun check- Type checkingbun check:watch- Watch mode type checkingbun format- Format code with Biomebun lint- Lint code with Biome
bun posts- Generate content treebun compress:images- Optimize images to WebPbun compress:text- Compress text assetsbun bake- Full production buildbun preview- Preview production build
bun check:18n- Validate translation completenessbun json:to:yaml- Convert JSON configs to YAML
No environment variables are required for basic operation. All configuration is done through:
src/lib/constants.ts- Application constantstailwind.config.ts- Styling configurationsvelte.config.js- SvelteKit configuration
User preferences are stored in localStorage:
lang- Interface languagetheme- UI theme preferencetrafficEconomy- Image optimization setting
- Automatic WebP conversion
- Traffic economy mode for reduced bandwidth
- Lazy loading with proper sizing
- Responsive image serving
- Gzip and Brotli compression for all text assets
- Optimized bundle splitting
- Static generation for fast loading
- Immutable assets with cache headers
- Service worker ready (via SvelteKit)
- Optimized for CDN distribution
Build failures:
# Clear build cache
rm -rf .svelte-kit build node_modules
bun installImage processing errors:
- Ensure Sharp is properly installed:
bun add sharp - Check image file permissions and formats
Translation validation errors:
bun check:18n # Shows missing/extra keysEnable SvelteKit debugging:
DEBUG=vite:* bun dev- SvelteKit 5 - Application framework
- Tailwind CSS 4 - Styling framework
- TypeScript - Type safety
- markdown-it - Markdown processing
- markdown-it-deflist
- Sharp - Image optimization
- Highlight.js - Syntax highlighting
- Biome - Code linting and formatting
- Vite - Build tool
- Bun - Runtime and package manager
- Fork the repository
- Create feature branch:
git checkout -b feature/amazing-feature - Make changes and test thoroughly
- Run linting and type checking:
bun lint && bun check - Commit changes:
git commit -m 'Add amazing feature' - Push to branch:
git push origin feature/amazing-feature - Open a Pull Request
This project is open source. Please check the repository for license details.
- Svelte Team - For the amazing framework
- Tailwind Labs - For the utility-first CSS framework
- Highlight.js - For syntax highlighting
- MDI - For beautiful icons