Markdown Pipeline
Blog posts are processed through this pipeline:gray-matter
Parses YAML frontmatter and separates it from contentPackage:
[email protected]remark
Converts markdown to HTML using the remark processorPackage:
[email protected]remark-html
Compiles markdown to HTML with sanitization enabledPackage:
[email protected]File: src/lib/blog.ts:84HTML is sanitized for security (
sanitize: true), so raw HTML tags in markdown are stripped out. Always use markdown syntax instead.Supported Syntax
Headings
Markdown headings automatically receive Spotify-themed styling:Styling Applied
- H1: Gradient text effect (green to light green), 4xl/5xl size
- H2: Left border accent, background tint, 2xl/3xl size
- H3: Subtle left border, 1xl/2xl size
src/lib/blog.ts:110
Paragraphs
Standard paragraph text with enhanced readability:src/lib/blog.ts:129
Emphasis
Bold Text
Receives a gradient background with left border accent: File:src/lib/blog.ts:160
Italic Text
Displayed in Spotify green with an animated underline: File:src/lib/blog.ts:166
Links
Links are automatically styled with different treatments for internal vs external:Styling Features
- Spotify green color with hover animation
- Underline decoration with offset
- Hover background tint
- External links open in new tab with
rel="noopener noreferrer"
src/lib/blog.ts:135
Code
Two types of code formatting:Inline Code
src/lib/blog.ts:154
Code Blocks
- Black background with transparency
- Rounded corners with border
- Green glow shadow effect
- Horizontal scroll for long lines
src/lib/blog.ts:147
Lists
Both ordered and unordered lists are supported:- Custom green bullet points with glow effect
- Enhanced spacing between items
- Responsive text sizing
src/lib/blog.ts:179
Blockquotes
Blockquotes receive special Spotify-inspired treatment:- Left border accent in Spotify green
- Gradient background fade
- Decorative opening quote mark
- Italic text with shadow
src/lib/blog.ts:172
Real Example from: src/content/blog/openai-townhall.md:23
Images
Images are enhanced with figure captions and hover effects:- Rounded corners with shadow
- Hover zoom animation (scale 1.05)
- Figure caption from alt text
- Lazy loading for performance
- Max width constraint for readability
src/lib/blog.ts:193
Real Examples from: src/content/blog/intern-experience-aws.md
Horizontal Rules
Create visual breaks with horizontal rules:src/lib/blog.ts:187
Unsupported Features
The following markdown features are not supported due to HTML sanitization:- Raw HTML tags (use markdown instead)
- HTML comments
- Custom CSS classes or styles
- JavaScript or script tags
- iframes or embedded content
- Tables (not styled, but rendered as basic HTML)
Custom Styling System
TheapplyCustomStyling() function uses regex to transform HTML:
File: src/lib/blog.ts:106
Design System
The styling uses these Tailwind CSS custom colors:| Color Variable | Hex Value | Usage |
|---|---|---|
spotify-green | #1DB954 | Primary accent, links, borders |
spotify-white | #FFFFFF | Text with opacity variations |
spotify-light-dark | Dark gray | Card backgrounds |
spotify-dark | Very dark | Main background |
Writing Best Practices
Real-World Examples
Examine these posts to see markdown in action:OpenAI Townhall
src/content/blog/openai-townhall.mdGreat example of:- Opening quote
- Personal narrative
- Multiple images
- External links
AWS Internship
src/content/blog/intern-experience-aws.mdFeatures:- H2/H3 structure
- Technical content
- Mixed media
- Emphasis usage
Dependencies
The markdown system relies on these packages: File:package.json:17
Next Steps
Creating Posts
Learn how to write and publish new blog posts
Blog Overview
Understand the blog architecture and routing