A beautiful, timeline-based blog template built with SvelteKit and MDsveX using Bun. Features light/dark mode, rich media support, animated SVG icons, and comprehensive examples.
- Bun Runtime - Fast JavaScript runtime and package manager
- Light/Dark Mode - Toggle between themes with persistent localStorage
- Timeline Layout - Clean, chronological blog presentation with featured posts
- Frontmatter Support - Title, blurb, date metadata
- Responsive Design - Mobile-first with 600px timeline, 1200px detail pages
- MDsveX Integration - Markdown with Svelte components
- Cookie Consent - GDPR-compliant modal on first visit
- Date-based Naming - YYYYMMDD-short-title.md convention
- Blog Posts - Rich blog entries with various layouts
- Research Documents - Academic papers with PDF embedding and ASCII diagram support
- Team Page - Showcase your team members
- About Page - Company information
- Rich Media Support:
- SVG graphics (static and animated)
- Images (PNG, JPG)
- Audio players
- Video players
- PDF viewers
- ASCII diagrams in code blocks
- HTML tables
- Syntax-highlighted code blocks
.media-left- Float media left with text wrapping (45% max-width).media-right- Float media right with text wrapping (45% max-width).media-center- Center media as block (100% max-width, centered).media-inline- Inline with text (200px max-width).media-blocked- Featured block with border/shadow (centered, fit-content).md-viewer- Markdown/ASCII diagram viewer (transparent background, centered, footnotesize)
- Bun installed on your system
cd md-template-blog
bun installLocal development with Bun (recommended):
bun run dev:bunOr with npm/Node.js:
npm run devVisit http://localhost:5173
Local build with Bun:
bun run build:bun
bun run preview:bunOr with npm/Node.js:
npm run build
npm run previewThe project is configured to deploy to Vercel with Node.js 20:
.node-versionfile specifies Node 20vercel.jsonconfigures build settingspackage.jsonincludes engine constraints for Node 18-20
The adapter will automatically use @sveltejs/adapter-vercel when deployed to Vercel.
md-timeline-blog/
βββ src/
β βββ docs/
β β βββ posts/ # Blog post markdown files (YYYYMMDD-title.md)
β β βββ research/ # Research document markdown files (YYYYMMDD-title.md)
β βββ routes/
β β βββ research/ # Research listing and detail pages
β β β βββ [slug]/ # Dynamic research doc pages
β β β βββ +page.svelte # Research listing (timeline)
β β β βββ +page.ts
β β βββ team/ # Team page
β β βββ about/ # About page
β β βββ [slug]/ # Dynamic blog post pages
β β βββ +layout.svelte # Main layout with theme toggle & navigation
β β βββ +layout.ts # Loads blog posts
β β βββ +page.svelte # Homepage timeline
β βββ lib/
β β βββ components/
β β β βββ ThemeToggle.svelte
β β β βββ CookieConsent.svelte
β β βββ stores/
β β βββ theme.ts # Theme state management
β βββ app.css # Global styles with dark mode & media classes
βββ static/
β βββ images/
β β βββ svg-icons/ # SVG icon files for animations
β β βββ favicon.svg
β βββ md/ # Markdown files for embedding (e.g., diagrams)
β βββ audio/ # Audio files
β βββ video/ # Video files
β βββ pdfs/ # PDF documents
βββ package.json
βββ bunfig.toml # Bun configuration
βββ svelte.config.js
βββ remark.config.js # Markdown processing configuration
βββ tailwind.config.js
βββ .gitignore
Create markdown files in src/docs/posts/ using the naming convention YYYYMMDD-short-title.md:
---
title: Your Post Title
blurb: Short description for timeline
date: 2025-12-14
---
Your content here with full markdown support...
### Media Examples
<div class="media-center">
<img src="/images/example.png" alt="Description" />
</div>Create markdown files in src/docs/research/ using the naming convention YYYYMMDD-short-title.md:
---
title: Research Paper Title
filename: paper.pdf
blurb: Paper abstract or summary
date: 2025-12-14
contents: Additional metadata
---
## Abstract
Your content...
## ASCII Diagram
<!-- Content source: static/md/diagram.md -->
<div class="md-viewer">
<div class="diagram-caption">
<strong>Diagram Title</strong> (2025-11-30)<br/>
<em>Diagram description</em>
</div>
Your ASCII art diagram here...
## PDF Viewer
<div class="pdf-viewer">
<embed src="/pdfs/your-paper.pdf" type="application/pdf" width="100%" height="800" />
</div>
- Background:
#fafafa - Text:
#111111 - Clean, bright appearance
- Background:
#1a1a1a - Text:
#e5e5e5 - Easy on the eyes
Theme persists via localStorage and can be toggled with the sun/moon icon in the header.
<!-- Centered -->
<div class="media-center">
<img src="/images/example.png" alt="Description" />
</div>
<!-- Left-floated with text wrap -->
<div class="media-left">
<img src="/images/example.png" alt="Description" width="300" />
</div>
<div class="clearfix">
Your text content wraps around the image...
</div><audio controls>
<source src="/audio/sample.mp3" type="audio/mpeg">
Your browser does not support audio.
</audio><video controls width="100%">
<source src="/video/sample.mp4" type="video/mp4">
Your browser does not support video.
</video>| Header 1 | Header 2 | Header 3 |
|----------|----------|----------|
| Data 1 | Data 2 | Data 3 |
| Data 4 | Data 5 | Data 6 |The template includes numerous animated SVG examples powered by SVG.js v3.2:
- Data Visualization - Animated bar charts, pie charts, progress circles
- Network Diagrams - Quarterly growth metrics with multi-stage animations
- Algorithm Complexity - Budget allocation pie charts with sequential slice reveals
- Geographic Maps - Interactive US map with random state zoom tours
- API Architecture - HTTP method and response code animations
- CI/CD Pipelines - Pipeline stages and deployment frequency charts
- Interactive Games - Pong game with SVG.js physics
- Path Animations - Shapes following curved paths with easing
All animations use the SVG.js library (v3.2) which is loaded globally in the layout. To create your own animations:
- Add a container div in your markdown:
<div class="media-center">
<div id="my-animation" style="max-width: 600px; margin: 0 auto;"></div>
</div>- Add a script block with SVG.js animation code:
<script>
import { onMount } from 'svelte';
onMount(() => {
function initAnimation() {
if (typeof SVG === 'undefined') {
setTimeout(initAnimation, 50);
return;
}
const WIDTH = 600;
const HEIGHT = 400;
// Create SVG canvas
const draw = SVG().addTo('#my-animation').size(WIDTH, HEIGHT);
// Add animated elements
const rect = draw.rect(100, 100).fill('#4a90e2');
rect.animate(1000).move(200, 150).loop();
return () => {
draw.remove();
};
}
const cleanup = initAnimation();
return cleanup;
});
</script>- Learn more about SVG.js animations:
- Sequential animations - Using delays and
.after()callbacks - Looping animations - With
.loop()for continuous effects - Easing functions - Like
.ease('<>')for smooth transitions - ViewBox manipulation - For zoom effects on geographic maps
- Path following - Using
.during()with.pointAt()for shapes on paths - Color transitions - Animating fill and stroke properties
- Timeline control - Using
.timeline().stop()for restart functionality
All SVG graphics are responsive, support dark mode, and use transparent backgrounds for seamless integration.
Features team members from Christopher Nolan films:
- Leadership: Dom Cobb, Bruce Wayne, Cooper
- Core Team: Arthur, Ariadne, Leonard Shelby, and more
- Advisors: Professor Brand, Miles, Yusuf
Customize by editing src/routes/team/+page.svelte
Edit CSS variables in src/app.css:
:root {
--color-bg: #fafafa;
--color-text: #111111;
/* ... */
}
[data-theme='dark'] {
--color-bg: #1a1a1a;
--color-text: #e5e5e5;
/* ... */
}:root {
--font-mono: ui-monospace, 'Cascadia Code', ...;
--font-serif: 'Georgia', 'Times New Roman', serif;
}- Modify
src/routes/+layout.sveltefor header/footer - Adjust
src/routes/+page.sveltefor timeline styling - Edit media positioning classes in
src/app.css
The template includes 11 example blog posts:
- Data Visualization Techniques
- Network Architecture Design
- Algorithm Complexity Analysis
- Geographic Data Analysis
- Machine Learning Pipelines
- User Experience Design
- RESTful API Design
- Database Optimization
- Security Architecture
- CI/CD Pipeline Design
- Rich Media Examples
Plus 3 research documents with PDF viewers.
- Bun - Runtime and package manager
- SvelteKit - Web framework
- Svelte 5 - Latest reactive framework
- MDsveX - Markdown processor
- Tailwind CSS - Utility-first CSS
- TypeScript - Type safety
- Vite - Build tool
- SVG.js v3.2 - Animated SVG graphics library
remark-gfm- GitHub Flavored Markdownremark-frontmatter- YAML frontmatterrehype-slug- Heading IDsrehype-autolink-headings- Heading linksrehype-raw- HTML in markdown
.media-left /* Float left, 45% max-width */
.media-right /* Float right, 45% max-width */
.media-center /* Block center, 100% max-width, centered */
.media-inline /* Inline, 200px max-width */
.media-blocked /* Block with border/shadow, centered, fit-content */
.md-viewer /* Markdown viewer, transparent background, centered, 0.7rem font */
.clearfix /* Clear floats */The template uses a dual-width approach:
- Timeline pages (home, research listing, about, team):
max-width: 600px - Detail pages (blog posts, research docs):
max-width: 1200px(double the timeline width) - Mobile (< 768px): Full width with responsive adjustments
- Header/Footer: Always constrained to 600px regardless of page type
- Images - Use descriptive alt text
- SVGs - Keep code readable, use semantic IDs
- Tables - Use headers, keep data organized
- Media - Optimize file sizes
- Dark Mode - Test all content in both themes
- Accessibility - Maintain ARIA labels
- Optimize images before uploading
- Use lazy loading for media
- Keep SVGs simple and efficient
- Minimize JavaScript in markdown
- Use system fonts when possible
- Theme preference persists in localStorage
- All example posts use lorem ipsum placeholder text
- SVG diagrams work in both light and dark modes
- PDF viewers require browser support
- Mobile responsive by default
Feel free to customize this template for your needs! The codebase is well-documented and modular.
This template is free to use for personal and commercial projects.
- Layout inspiration: Physical Intelligence research blog
- Framework: SvelteKit and MDsveX
- Runtime: Bun
- Typography: System fonts
- Team names: Christopher Nolan films
- Developer: Claude Code
- Prompted by: Tankbottoms
Ready to start?
- With Bun:
bun install && bun run dev:bun - With npm:
npm install && npm run dev
Visit localhost:5173
