Magic UI Changelog Template

repository·main·Indexed 42 days ago

https://github.com/magicuidesign/changelog-template

A minimal, high-performance changelog template built with Next.js 15 and Fumadocs. It features a visual timeline and MDX-based content management for showcasing product releases, features, and bug fixes.

Tokens
1.7K
Snippets
9
Records
10
Agent score
53%

What's inside Magic UI Changelog Template

  1. Project structure and file organization

    main

    The project follows a standard Next.js App Router structure with Fumadocs for MDX content management:

    • app/: Contains the Next.js App Router files (layout.tsx, page.tsx, etc.).
    • changelog/content/: The directory where all MDX changelog entries are stored.
    • components/: React components, including ui/ (shadcn/ui) and theme utilities.
    • lib/: Utility functions.
    • public/: Static assets.
    • mdx-components.tsx: Custom MDX component overrides.
    • source.config.ts: Configuration for Fumadocs.
  2. Add new changelog entries using MDX

    main

    Changelog entries are written in MDX format. To add a new entry, create a new file in the changelog/content/ directory. The filename must follow the YYYY-MM-DD.mdx format.

    Each file must include a frontmatter block with the following keys:

    • title: The title of the update.
    • description: A brief summary of the changes.
    • date: The release date in YYYY-MM-DD format.
    • tags: An array of strings (e.g., ["Feature", "Bug Fix"]).
    • version: The version number string.
    ---
    title: "Your Update Title"
    description: "Brief description"
    date: "2025-06-15"
    tags: ["Feature", "Bug Fix"]
    version: "1.2"
    ---
    
    Your changelog content here...
  3. Configure site metadata via siteConfig

    main

    The siteConfig object is the central configuration for project metadata, including the site name, URL, description, social links, and SEO keywords. You can modify this object to update how the site is identified by search engines and social platforms.

    Available keys in siteConfig:

    • name: The display name of the site.
    • url: The canonical URL of the project.
    • description: A brief summary of the project.
    • links: An object containing social media links (e.g., twitter, github).
    • keywords: An array of strings used for SEO.

    You can also use the SiteConfig type to ensure type safety when passing this configuration to other parts of your application.

    export const siteConfig = {
      name: "Changelog Template",
      url: "https://changelog-magicui.vercel.app",
      description: "A minimal changelog template built using Next.js.",
      links: {
        twitter: "https://x.com/magicuidesign",
        github: "https://github.com/magicuidesign",
      },
      keywords: [
        "Changelog",
        "Next.js",
        "Fumadocs",
        "Tailwind CSS",
        "shadcn",
        "Magic UI",
      ],
    }
    
    export type SiteConfig = typeof siteConfig
  4. Define changelog documentation schema with defineDocs

    main

    Use defineDocs to specify the directory containing changelog content and to extend the frontmatter schema. This allows you to enforce specific metadata requirements for each changelog entry.

    By extending frontmatterSchema, you can require or optionally include fields like date, tags, and version in your MDX files.

    export const { docs, meta } = defineDocs({
      dir: "changelog/content",
      docs: {
        schema: frontmatterSchema.extend({
          date: z.string(),
          tags: z.array(z.string()).optional(),
          version: z.string().optional(),
        }),
      },
    })
  5. Configure Prettier formatting rules

    main

    The project uses a .prettierconfig.cjs file to enforce consistent code formatting. The following configuration is applied:

    • endOfLine: Set to "lf" to ensure Unix-style line endings.
    • semi: Set to false to omit semicolons.
    • singleQuote: Set to false to use double quotes.
    • tabWidth: Set to 2 spaces.
    • trailingComma: Set to "es5" to include trailing commas where valid in ES5.
    /** @type {import('prettier').Config} */
    module.exports = {
      endOfLine: "lf",
      semi: false,
      singleQuote: false,
      tabWidth: 2,
      trailingComma: "es5",
    };
  6. Configure the changelog project with defineConfig

    main

    Use defineConfig to set global configuration options for the project. Currently, it supports setting the lastModifiedTime strategy and configuring mdxOptions for component resolution.

    export default defineConfig({
      lastModifiedTime: "git",
      mdxOptions: {
        providerImportSource: '@/mdx-components',
      },
    })
  7. Available npm scripts

    main

    The project provides the following scripts via pnpm:

    • pnpm dev: Starts the development server.
    • pnpm build: Builds the project for production.
    • pnpm start: Starts the production server.
    • pnpm lint: Runs linting to check code quality.
    pnpm dev
    pnpm build
    pnpm start
    pnpm lint
  8. Reference: Changelog Frontmatter Schema Fields

    main

    When creating changelog entries in the changelog/content directory, the following frontmatter fields are supported via the extended schema:

    • date: A required string representing the entry date.
    • tags: An optional array of strings used for categorizing entries.
    • version: An optional string representing the software version associated with the entry.
    // Schema definition used for validation:
    // date: z.string()
    // tags: z.array(z.string()).optional()
    // version: z.string().optional()