Hello blog!

Welcome to my blog! This is a test post showcasing various MDX features and formatting options.

June 20, 2025
5 min read
blog
mdx
welcome


Hello blog! 👋


Welcome to my blog! This is a test post where I'm exploring all the amazing features that MDX has to offer. Let's dive into the various formatting options and see what works best.


What is MDX?


MDX is a powerful format that lets you write JSX directly in your Markdown documents. It combines the simplicity of Markdown with the power of React components, making it perfect for technical blogs where you need both rich content and interactive elements.


Key Features of MDX


MDX brings together the best of both worlds:

Write in familiar Markdown syntax
Embed React components directly
Use JSX for complex layouts
Maintain static site generation benefits

Why I started this blog


I've been building web applications for a while now, and I thought it was time to share my experiences, lessons learned, and cool discoveries with the developer community.


Here are a few reasons why I decided to start blogging:


Knowledge sharing - Help other developers avoid the pitfalls I've encountered
Learning reinforcement - Teaching is one of the best ways to solidify understanding
Community building - Connect with fellow developers and learn from their experiences
Documentation - Keep track of solutions I've found for future reference

Code Examples


Let's test some code highlighting with different languages:


Frontend Examples


Here are some examples from the frontend world:


TypeScript/React Component


tsx
interface BlogPostProps {
  title: string;
  description: string;
  date: string;
  readTime: string;
  tags: string[];
}

const BlogPost: React.FC<BlogPostProps> = ({ 
  title, 
  description, 
  date, 
  readTime, 
  tags 
}) => {
  return (
    <article className="max-w-2xl mx-auto">
      <header className="mb-8">
        <h1 className="text-3xl font-bold mb-2">{title}</h1>
        <p className="text-muted-foreground mb-4">{description}</p>
        <div className="flex items-center gap-4 text-sm text-muted-foreground">
          <time dateTime={date}>{new Date(date).toLocaleDateString()}</time>
          <span>{readTime}</span>
        </div>
        <div className="flex gap-2 mt-4">
          {tags.map((tag) => (
            <span 
              key={tag} 
              className="px-2 py-1 bg-primary/10 text-primary rounded-md text-xs"
            >
              #{tag}
            </span>
          ))}
        </div>
      </header>
    </article>
  );
};

Backend Examples


Now let's look at some backend code:


Next.js API Route


javascript
// pages/api/blog/[slug].js
export default async function handler(req, res) {
  const { slug } = req.query;
  
  if (req.method === 'GET') {
    try {
      const post = await getBlogPost(slug);
      
      if (!post) {
        return res.status(404).json({ error: 'Post not found' });
      }
      
      res.status(200).json(post);
    } catch (error) {
      console.error('Error fetching blog post:', error);
      res.status(500).json({ error: 'Internal server error' });
    }
  } else {
    res.setHeader('Allow', ['GET']);
    res.status(405).end(`Method ${req.method} Not Allowed`);
  }
}

Python Script


python
import os
import json
from datetime import datetime

def generate_blog_metadata(posts_dir: str) -> dict:
    """
    Generate metadata for all blog posts in a directory.
    """
    metadata = {
        'posts': [],
        'generated_at': datetime.now().isoformat(),
        'total_posts': 0
    }
    
    for filename in os.listdir(posts_dir):
        if filename.endswith('.mdx'):
            post_path = os.path.join(posts_dir, filename)
            
            with open(post_path, 'r', encoding='utf-8') as file:
                content = file.read()
                
                # Extract frontmatter (simplified)
                if content.startswith('---'):
                    end_index = content.find('---', 3)
                    frontmatter = content[3:end_index]
                    
                    metadata['posts'].append({
                        'filename': filename,
                        'slug': filename.replace('.mdx', ''),
                        'frontmatter': frontmatter.strip()
                    })
    
    metadata['total_posts'] = len(metadata['posts'])
    return metadata

# Usage
if __name__ == "__main__":
    posts_metadata = generate_blog_metadata('./src/posts')
    print(json.dumps(posts_metadata, indent=2))

SQL Query


sql
-- Get blog posts with tag statistics
SELECT 
    p.id,
    p.title,
    p.published_at,
    p.read_time,
    COUNT(pt.tag_id) as tag_count,
    STRING_AGG(t.name, ', ') as tags
FROM blog_posts p
LEFT JOIN post_tags pt ON p.id = pt.post_id
LEFT JOIN tags t ON pt.tag_id = t.id
WHERE p.published = true
GROUP BY p.id, p.title, p.published_at, p.read_time
ORDER BY p.published_at DESC
LIMIT 10;

Lists and Formatting


Unordered List

Web development with Next.js and React
TypeScript for type-safe applications
Building scalable backend APIs
UI/UX design with Tailwind CSS
Database design and optimization

Ordered List

1.
Plan - Define requirements and architecture
2.
Design - Create wireframes and choose tech stack
3.
Develop - Write clean, maintainable code
4.
Test - Unit tests, integration tests, e2e tests
5.
Deploy - CI/CD pipelines and monitoring
6.
Iterate - Gather feedback and improve

Nested Lists

Frontend Technologies
React/Next.js
TypeScript
Tailwind CSS
Framer Motion
Backend Technologies
Node.js
tRPC
Drizzle ORM
PostgreSQL
DevOps & Tools
Vercel/Cloudflare
GitHub Actions
Docker
Monitoring & Analytics

Blockquotes


"The best way to learn is by building real projects and sharing your knowledge with others."

Pro Tip: Always write code that your future self will thank you for. Comment your complex logic, use meaningful variable names, and structure your projects consistently.


Check out some of my favorite resources:


Next.js Documentation - Comprehensive guide to Next.js
TypeScript Handbook - Everything you need to know about TypeScript
Tailwind CSS - Utility-first CSS framework
tRPC - End-to-end typesafe APIs
React Documentation - The official React docs

Images


Here's how images look in the blog:


Hubert "Hukasx0" Kasperek - GitHub Profile picture

Hubert "Hukasx0" Kasperek - GitHub Profile picture


This is how image captions look - clean and simple.


Tables


TechnologyUse CaseLearning CurveRating
ReactFrontend UIMedium⭐⭐⭐⭐⭐
Next.jsFull-stack frameworkMedium⭐⭐⭐⭐⭐
TypeScriptType safetyHigh⭐⭐⭐⭐⭐
Tailwind CSSStylingLow⭐⭐⭐⭐⭐
tRPCAPI developmentMedium⭐⭐⭐⭐
Drizzle ORMDatabase ORMLow⭐⭐⭐⭐

Inline Formatting


You can use bold text, italic text and inline code.


Here's a sentence with code snippets mixed with regular text. Perfect for mentioning functions like useState() or useEffect() in React.


Mathematical Expressions


Sometimes you need to explain algorithms or complexity:


Time Complexity: O(n log n)
Space Complexity: O(1)
Binary search: O(log n)



This blog supports automatic anchor links for all headings! Here's how they work:


Hover over any heading - You'll see a hash (#) icon appear
Click the hash icon - It will copy the direct link to that section to your clipboard
Visual feedback - A toast notification confirms when the link is copied
Share specific sections - Send others direct links to specific parts of these posts


Try clicking these links to jump to different sections:



Technical Implementation


The anchor links are automatically generated by:

1.
Extracting text from heading content
2.
Converting to slug - lowercase, replace spaces with hyphens
3.
Adding ID attribute to heading elements
4.
Smooth scrolling with scroll-mt-20 for proper offset

This makes it easy to create a table of contents or reference specific sections in longer articles!


Conclusion


This blog will be a space where I document my journey as a full-stack developer, share practical solutions to real problems, and hopefully help other developers along the way.


If you have any questions or suggestions for topics you'd like me to cover, feel free to reach out!


Happy coding! 🚀


Thanks for reading! This post was written to test various MDX formatting features. More technical content coming soon.


Thanks for reading!

I hope you found this article helpful, interesting, or useful! If you have questions, or just want to chat about web development, I'd love to hear from you.

Want to see what I'm building? Check out my projects or connect with me:

Published on June 20, 2025