Advanced Markdown Features
This post demonstrates various Markdown and MDX features that you can use in your blog posts.
Basic Formatting
You can use bold, italic, or both easily. You can also use strikethrough text.
Code Blocks
function greet(name) {
return `Hello, ${name}!`;
}
console.log(greet('World'));
You can also use inline code like const x = 100;
.
Lists
Unordered Lists
- Item 1
- Item 2
- Nested item 1
- Nested item 2
- Item 3
Ordered Lists
- First item
- Second item
- Third item
Blockquotes
This is a blockquote. It can span multiple lines.
And can have multiple paragraphs.
Links
You can create inline links or reference links.
Task Lists
- Write blog post
- Add MDX support
- Publish website
Using Shadcn UI Components
💡
This is possible because we're using MDX with contentlayer2!
Card One
This is created with plain divs and Tailwind.
Card Two
Mixing Markdown and HTML/JSX is powerful.
Conclusion
Using MDX with contentlayer2 gives you the best of both worlds: the simplicity of Markdown with the power of React components.