Web Logo
Back to blog
My Second Sample Post

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:

  1. Its own content (like this file) in its designated contentDirPath.
  2. Its contentlayer.config.ts using the shared createContentlayerSource function.
  3. The actual page routes (/blog and /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.

Enjoyed this article?

Join our newsletter to receive the latest updates on web development, design patterns, and best practices delivered straight to your inbox.

We respect your privacy. Unsubscribe at any time.