Apps
Marketing

Blog

Learn how to write blog posts in the monorepo.

The blog uses Content Collections, a markdown-based CMS. All content is written and styled using .mdx files. It's markdown combined with React components.

When content changes, you need to redeploy the marketing app because the pages are statically compiled and not dynamically fetched from a database.

Add a new blog post

To create a new blog post, follow these steps:

  1. Create a new file Navigate to the /apps/marketing/content/blog directory and create a new .mdx file. The file name will act as the URL slug for the post. For example:

    • File name: hello-world.mdx
    • URL: https://your-app.com/blog/hello-world
  2. Add metadata At the top of the .mdx file, include a frontmatter block. This block contains key metadata about your post, written in a YAML-like format enclosed by three dashes (---). Here's an example:

apps/marketing/content/blog/hello-world.mdx
---
title: How to create a blog post
description: A description of your blog posts.
published: 2025-01-20T12:00:00.000Z
category: Innovation
author: elon-tusk
---

Things like reading time are automatically calculated.

Add a new author

You don't want to repeat all the author information, it's easier to create the author once and just use reference. In the /apps/marketing/content/authors directory add elon-tusk.mdx:

apps/marketing/content/authors/elon-tusk.mdx
---
ref: elon-tusk
name: Elon Tusk
avatar: https://randomuser.me/api/portraits/men/81.jpg
---

Then you can reference the author with author: elon-tusk in your blog frontmatter blocks.