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.
.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)cd md-template-blog
bun install
Local development with Bun (recommended):
bun run dev:bun
Or with npm/Node.js:
npm run dev
Visit http://localhost:5173
Local build with Bun:
bun run build:bun
bun run preview:bun
Or with npm/Node.js:
npm run build
npm run preview
The project is configured to deploy to Vercel with Node.js 20:
.node-version file specifies Node 20vercel.json configures build settingspackage.json includes engine constraints for Node 18-20The 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>
#fafafa#111111#1a1a1a#e5e5e5Theme 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:
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: ```html
3. **Learn more** about SVG.js animations:
- [SVG.js Documentation](https://svgjs.dev/docs/3.2/)
- [Animation Guide](https://svgjs.dev/docs/3.2/animating/)
- [Tutorial Examples](https://svgjs.dev/docs/3.2/tutorials/)
- [API Reference](https://svgjs.dev/docs/3.2/shape-elements/)
### Animation Techniques Used
- **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.
## š„ Team Page
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`
## š§ Customization
### Colors
Edit CSS variables in `src/app.css`:
```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;
}
src/routes/+layout.svelte for header/footersrc/routes/+page.svelte for timeline stylingsrc/app.cssThe template includes 11 example blog posts:
Plus 3 research documents with PDF viewers.
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:
max-width: 600pxmax-width: 1200px (double the timeline width)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.
Ready to start?
bun install && bun run dev:bunnpm install && npm run devVisit localhost:5173