Next.jsReact博客

next-mdx-blog — Next.js 博客模板

作者 dannyrmc

基于 Next.js、MDX、Tailwind CSS 和 TypeScript 的本地博客模板,内容以 .mdx 文件存放在 _posts 目录,适合希望自行掌控设计与内容的写作者。

看看你的网站会是什么样

浏览真实页面截图,比较内容排版与手机效果。点击下方缩略图切换,放大查看整页细节。

3 个预览视图
桌面端首页1 / 3
桌面端截图首屏预览

由服务器浏览器实际访问页面后截取。

全部页面与视图 3

截图用于了解视觉与布局,交互效果请以实际项目为准。

采集于 2026-10-14查看来源

值得关注的模板亮点

从已有项目资料中,快速了解它的特点。

01

使用 MDX 编写内容,支持在 Markdown 中嵌入自定义组件

02

内置 Image、Callout、Highlighter、InlineCode 和代码块等 MDX 组件

03

提供深色模式与动态图片加载模糊效果

04

自动计算博客文章阅读时间

05

已初始化 Shadcn/ui,README 注明自定义排版 prose 仍在进行中

06

内容文件集中存放在 /_posts 目录,新增文章只需添加 .mdx 文件

模板详细介绍

该模板将博客内容与页面实现放在同一个 Next.js 项目中,README 说明其使用 Next.js、Tailwind CSS、MDX 和 TypeScript 构建,属于本地托管的博客模板。内容以 .mdx 文件形式放在 /_posts 目录,新增文章只需添加 .mdx 文件,文件名要求全小写并用短横线代替空格。除标准 Markdown 语法外,模板预置了 Image、Callout、Highlighter、InlineCode 和代码块等 MDX 组件,其中 Image 支持可选的 caption 与 border 属性,代码块可通过首行反引号后的语言标识指定语言,使用 text 可避免代码格式化。功能方面 README 列出 MDX、深色模式、可自定义 MDX 组件、格式化代码块、动态图片加载模糊效果、文章阅读时间计算、已初始化 Shadcn/ui,以及仍在进行中的自定义排版 prose。README 未说明内容管理后台、评论、搜索、RSS、分页、多语言或部署平台支持等能力,也未提供除本地运行外的部署步骤。

Next.js博客

适合你的项目吗?

适用场景

  • 在本地运行并维护个人博客,内容以 .mdx 文件形式管理
  • 在 Markdown 文章中使用预置的 Image、Callout、Highlighter 等组件增强排版
  • 为代码示例指定语言并展示格式化代码块
  • 希望自行调整 Tailwind CSS 样式与 MDX 组件实现的博客项目

适合人群

  • 希望完全掌控博客设计与内容的开发者或写作者
  • 熟悉 Next.js、TypeScript 与 MDX 工作流的前端用户
  • 需要本地托管、以文件方式管理文章内容的个人博客

上手与定制指南

结合仓库当前版本的说明,按下面的资料检查内容、配置与运行要求。

  1. 1

    需预先安装 node 与 npm

  2. 2

    在项目根目录执行 npm install 安装 package.json 中的依赖

  3. 3

    执行 npm run dev 启动开发服务器

  4. 4

    在浏览器访问 http://localhost:3000 查看本地站点

  5. 5

    新增文章时在 /_posts 目录添加 .mdx 文件,文件名必须全小写并使用短横线代替空格

查看仓库使用说明

授权与来源资料

使用条件与限制

免费使用 · 保留许可声明

本次收录的是公开仓库中采用 MIT 许可的免费版本;免费范围为该版本代码,不代表外部服务或第三方素材免费。

使用时需要遵守

  • 允许免费使用、修改、商用和分发该版本代码。
  • 分发代码副本或实质性部分时,保留原作者版权声明和完整 MIT 许可声明。
  • 代码按现状提供;担保与责任限制以原许可证及适用法律为准。

额外费用与待核对事项

  • 演示图片、字体、图标及其他第三方素材需按各自许可核对,不能仅凭代码的 MIT 许可判断。
  • 域名、托管、数据库、支付或 AI 等外部服务可能另外收费。
  • 新增文章时,文件名必须全部使用小写字母,并用短横线代替空格,否则不符合模板要求。
  • 若希望代码块不被格式化,需要将语言标识改为 text。
查看原文依据

Permission is hereby granted, free of charge

许可证原文

> The filename must be lowercase and use dashes instead of spaces.

README 原文

To escape the code formatting, change the language to `text`.

README 原文
https://github.com/dannyrmc/next-mdx-blog/blob/main/LICENSEhttps://github.com/dannyrmc/next-mdx-blog/blob/main/README.md

DeepSeek 根据仓库许可证和 README 整理 ·2026-10-14。结果仅覆盖已读取资料,依赖、图片、字体及后续条款变更以各自原文为准。

项目核对记录与介绍依据

模板资料

来源平台
GitHub
资料与维护参考分
资料较完整 · 80 / 100
技术栈
Next.js · React
网站类型
博客
这个分数如何计算

本站按许可资料(最高30分)、演示链接(12分)、预览图(10分)、Star数(15分)、记录的维护时间(15分)、描述完整度(8分)、功能记录(5分)和分类资料(5分)计算。它不是代码、安全或性能测试,也不是 Google 评分;有链接不代表已实测可用。

这个项目需要核对什么

记录的仓库更新时间
2026-01-27
截图检查日期
2026-10-14

已收录演示链接。请用你的内容与屏幕尺寸检查;有演示不代表表单、认证或支付已经可用。

目录记录的主要技术栈是 Next.js。请通过依赖清单和锁文件核对实际版本与托管要求。这些说明基于收录资料,不代表代码审计或部署实测。

查看具体选型方法 →

介绍的制作与核对状态

介绍由 AI 辅助整理目录与仓库资料。仓库作者不等于这篇介绍的审核者。

审核声明: codex-user-requested-batch-review-20261017 · 2026-10-16

查看当时使用的来源资料

SHA-256: 678a8facf6b7ea581b0ab290be5773b4abedba6f756f54f48da44f13295bc403

2026-10-14T10:00:24.812Z

来源文件 / 仓库
# MDX and Next.js Blog Template

![Cover image of Blog](/public/images/readme-cover.png)

Crafted blog template built using Next.js, Tailwind CSS, MDX, and TypeScript. This locally hosted blog is for those who want full control of the design and content.

## Features

- MDX (Extended Markdown)
- Dark Mode
- Customizable MDX components
- Formatted code block
- Loading blur for dynamic images
- Calculated blog post reading time
- Shadcn/ui initiated
- Custom typography prose (in progress)

## Performance

As of this writing, Blog has achieved a 100% Lighthouse score.

---

## Install & Run

1. Make sure you have `node` and `npm` installed.

2. Install dependencies from [/package.json](/package.json):

   ```bash
   npm install
   ```

3. Start the dev server:

   ```bash
   npm run dev
   ```

4. View app locally in the browser

   ```bash
   http://localhost:3000
   ```

## Add Content

The MDX content is located in the [/\_posts](/_posts) directory. This is where you can add or modify content.

Just add a new file with the extension of `.mdx`

For example, `first-post.mdx`

> [!IMPORTANT]  
> The filename must be lowercase and use dashes instead of spaces.

```bash
🚫 filename with spaces.mdx
```

```bash
✅ filename-with-dashes.mdx
```

---

## Using MDX Components

![Cover image of Blog](/public/images/readme-mdx-components.png)

In addition to standard Markdown features, Blog comes with a few predefined MDX components.

### Image Component

```markdown
<Image
  src="/images/placeholder.webp"
  alt="Description of image"
/>
```

You can also add an optional `caption` and/or `border`.

```markdown
<Image
  src="/images/sample.webp"
  alt="Description of image"
  caption="Image caption"
  border
/>
```

### Callout Component

```markdown
<Callout emoji="💡">
  This is a callout component with an emoji
</Callout>
```

### Highlighter Component

```markdown
<Highlighter>
  Highlighted sentence.
</Highlighter>
```

### Inline Code Component

```markdown
<InlineCode>
  node
</InlineCode>
```

### Code Block Component

Similar to Markdown, code blocks are formatted by surrounding the code with backtick marks.

You can also specify the coding language after the first 3 backtick marks.

````markdown
```javascript
const Category = (props) => {
  return (
    <div className="rounded-3xl border p-2">
      <p className="text-sm font-bold uppercase leading-3 tracking-widest">
        {props.category_label}
      </p>
    </div>
  );
};
export default Category;
```
````

To escape the code formatting, change the language to `text`.

````bash
```text
filename_1.jpg
filename_2.jpg
filename_3.jpg
```
````

---

## License

This project is licensed under the [MIT License](/LICENSE).
反馈内容错误

看看同类模板

对比同技术栈与用途的模板,找到更适合的视觉与内容结构。