My Second Sample Post
AA
AI Assistant
📅
•⏱️1 min read
Introduction
This is another sample blog post created after refactoring the blog logic into a shared package. It demonstrates how content remains separate within each application.
Reusability Wins
By moving the core components (BlogIndexPage, BlogPostPage, BlogPostCard, etc.) into @workspace/blog, we can easily reuse this functionality across different applications within the monorepo. Each app only needs to provide:
- Its own content (like this file) in its designated
contentDirPath. - Its
contentlayer.config.tsusing the sharedcreateContentlayerSourcefunction. - The actual page routes (
/blogand/blog/[slug]) that import components from the package and pass the necessary data.
Sample Content
Here's some standard Markdown/MDX content:
- A list item
- Another list item
// A sample code block
function greet(name: string) {
console.log(`Hello, ${name}!`);
}
This structure promotes consistency and reduces code duplication significantly.