以 Ghost 作为无头 CMS,通过 Content API 获取文章、页面与标签内容
nuxt-template-ghost — Nuxt 启动器模板
作者 serman
基于 Nuxt 的博客启动模板,把 Ghost 作为无头 CMS,通过 Content API 拉取文章、页面与标签并静态生成站点。
看看你的网站会是什么样
浏览真实页面截图,比较内容排版与手机效果。点击下方缩略图切换,放大查看整页细节。
全部页面与视图 3
截图用于了解视觉与布局,交互效果请以实际项目为准。
值得关注的模板亮点
从已有项目资料中,快速了解它的特点。
提供首页、文章详情、Ghost 静态页面、标签页和 sitemap.xml 等页面结构
支持静态生成:pnpm generate 产出静态站点,pnpm preview 本地预览
文章正文样式集中在 app/assets/css/ghost.css,便于统一调整排版与卡片外观
通过 Nuxt Image 优化图片,需在 nuxt.config.ts 中配置图片域名
模板详细介绍
这是一个把 Ghost 当作无头 CMS 的 Nuxt 博客模板。它通过 Ghost Content API 获取内容,提供首页文章列表、文章详情(/posts/[slug])、Ghost 静态页面(/[slug])、标签页(/tag/[slug])以及自动生成的 sitemap.xml。构建方式为静态生成(pnpm generate 后 pnpm preview),因此适合把 Ghost 内容发布成静态站点。
使用前需要在根目录创建 .env,填入 GHOST_URL 与 GHOST_CONTENT_API_KEY 两个变量,然后运行 pnpm dev 在本地 3000 端口预览。模板使用 Nuxt UI 组件与 Tailwind CSS,支持深色模式,并通过 Nuxt Image 处理图片:需要在 nuxt.config.ts 的 image.domains 中加入图片所在域名,useGhostContent.ts 中有一段预处理逻辑,会把 img 标签的 src 替换为 Nuxt Image 的优化地址,从而在构建时下载并优化图片。
README 明确说明 Ghost 输出的大量 CSS 类并非 Tailwind 类,且 Ghost 的动态卡片(cards)只实现了一部分样式,因此文章正文的呈现需要自行调整 CSS。所有文章内容样式集中在 app/assets/css/ghost.css,包含排版、卡片样式、明暗模式变量与响应式断点;布局在 app/layouts/default.vue,组件在 app/components/ 下。README 也提到开发过程大量借助 Cursor AI,作者本人复核并做了修改。
适合你的项目吗?
适用场景
- 已有 Ghost 站点,希望用 Nuxt 前端静态发布其内容
- 需要一个包含文章列表、详情、标签与静态页面的博客骨架
- 想以集中式 CSS 文件定制 Ghost 文章正文与卡片样式
适合人群
- 使用 Ghost 作为内容源、希望静态生成博客的开发者
- 熟悉 Nuxt 与 Tailwind CSS、愿意自行调整样式的团队
- 需要文章详情、标签页和 sitemap 等基础博客页面的项目
上手与定制指南
结合仓库当前版本的说明,按下面的资料检查内容、配置与运行要求。
- 1
在根目录创建 .env,设置 GHOST_URL 与 GHOST_CONTENT_API_KEY
- 2
运行 pnpm dev 启动开发服务器,默认访问 http://localhost:3000
- 3
构建静态站点使用 pnpm generate,随后用 pnpm preview 预览
- 4
在 nuxt.config.ts 的 image.domains 中加入所用图片的域名
- 5
Ghost 的 CSS 类与动态卡片样式未全部覆盖,需在 app/assets/css/ghost.css 中按需补充
授权与来源资料
使用条件与限制
免费使用 · 保留许可声明本次收录的是公开仓库中采用 MIT 许可的免费版本;免费范围为该版本代码,不代表外部服务或第三方素材免费。
使用时需要遵守
- 允许免费使用、修改、商用和分发该版本代码。
- 分发代码副本或实质性部分时,保留原作者版权声明和完整 MIT 许可声明。
- 代码按现状提供;担保与责任限制以原许可证及适用法律为准。
额外费用与待核对事项
- 演示图片、字体、图标及其他第三方素材需按各自许可核对,不能仅凭代码的 MIT 许可判断。
- 域名、托管、数据库、支付或 AI 等外部服务可能另外收费。
- 使用前必须在根目录创建 .env 文件,配置 Ghost 凭据,否则无法获取内容。
- 必须提供自有的 Ghost 实例地址与 Content API Key,即依赖外部 Ghost 服务与账号。
- Ghost 输出的许多 CSS 类并非 Tailwind 类,需自行定制 CSS 才能正确呈现。
- Ghost 动态卡片样式仅实现了一部分,未覆盖全部卡片,需自行补充。
- 使用 Nuxt Image 优化图片时,必须把图片所在域名加入 nuxt.config.ts 的 image.domains 数组。
查看原文依据
Permission is hereby granted, free of charge
许可证原文
Create a `.env` file in the root directory:
README 原文
GHOST_URL=https://your-ghost-instance.com GHOST_CONTENT_API_KEY=your-content-api-key-here
README 原文
Note: Ghost uses many CSS classes that are not Tailwind CSS classes, so you may need to customize the CSS to fit your needs.
README 原文
Also Ghost have many dynamic cards https://ghost.org/help/cards/. I have implemented some of the styles in the css file, but not all of them.
README 原文
https://github.com/serman/nuxt-template-ghost/blob/main/LICENSE.mdhttps://github.com/serman/nuxt-template-ghost/blob/main/README.mdAdd the domains of your images to the `image.domains` array.
README 原文
DeepSeek 根据仓库许可证和 README 整理 ·2026-10-13。结果仅覆盖已读取资料,依赖、图片、字体及后续条款变更以各自原文为准。
项目核对记录与介绍依据
模板资料
- 来源平台
- GitHub
- 资料与维护参考分
- 资料较完整 · 83 / 100
- 技术栈
- Nuxt · Vue
- 网站类型
- 启动器
这个分数如何计算
本站按许可资料(最高30分)、演示链接(12分)、预览图(10分)、Star数(15分)、记录的维护时间(15分)、描述完整度(8分)、功能记录(5分)和分类资料(5分)计算。它不是代码、安全或性能测试,也不是 Google 评分;有链接不代表已实测可用。
这个项目需要核对什么
- 记录的仓库更新时间
- 2025-11-28
- 截图检查日期
- 2026-10-13
已收录演示链接。请用你的内容与屏幕尺寸检查;有演示不代表表单、认证或支付已经可用。
目录记录的主要技术栈是 Nuxt。请通过依赖清单和锁文件核对实际版本与托管要求。这些说明基于收录资料,不代表代码审计或部署实测。
查看具体选型方法 →介绍的制作与核对状态
介绍由 AI 辅助整理目录与仓库资料。仓库作者不等于这篇介绍的审核者。
审核声明: [email protected] · 2026-10-13
查看当时使用的来源资料
SHA-256: cd0bc1c68a23a117a04b506f211bdac30f17d796d08a6a445b8057cee55aee87
2026-10-13T08:49:26.419Z
来源文件 / 仓库# Ghost Blog with Nuxt 4
A modern, SSR-enabled blog using Ghost as a headless CMS, built with Nuxt 4 and Nuxt UI.
**🚀 [Live Demo](https://nuxt-static-template-ghost.netlify.app/)**
The development has been heavly assited by Cursor AI and I have reviewed the code and made some changes to fit my needs.
## Quick Start
1. **Set up your Ghost credentials**:
Create a `.env` file in the root directory:
```bash
GHOST_URL=https://your-ghost-instance.com
GHOST_CONTENT_API_KEY=your-content-api-key-here
```
2. **Run the development server**:
```bash
pnpm dev
```
3. **Open your browser**:
Navigate to [http://localhost:3000](http://localhost:3000)
## Features
This is a simple blog template that uses Ghost as a headless CMS and Nuxt 4 as a frontend framework.
✅ Server-Side Rendering (SSR) for optimal performance and SEO
✅ Responsive design with Nuxt UI components
✅ Dark mode support
✅ Optimized images with Nuxt Image
✅ Type-safe Ghost API integration
✅ SEO meta tags and Open Graph support
✅ Clean, modern UI with Tailwind CSS
But it can be customized to fit your needs.
Note: Ghost uses many CSS classes that are not Tailwind CSS classes, so you may need to customize the CSS to fit your needs.
Also Ghost have many dynamic cards https://ghost.org/help/cards/. I have implemented some of the styles in the css file, but not all of them.
## Pages
- **Homepage** (`/`) - List of latest posts with images, excerpts, and metadata
- **Post Detail** (`/posts/[slug]`) - Full post content with author info and tags
- **Static Pages** (`/[slug]`) - Ghost pages (About, Contact, etc.)
- **Tag Pages** (`/tag/[slug]`) - Posts filtered by tag
- **Sitemap** (`/sitemap.xml`) - Auto-generated XML sitemap for SEO
## Tech Stack
- **Framework**: Nuxt 4
- **UI Library**: Nuxt UI 4
- **CMS**: Ghost (Headless)
- **Styling**: Tailwind CSS
- **TypeScript**: Full type safety
- **Image Optimization**: Nuxt Image
```
## Building for Production
```bash
pnpm generate
pnpm preview
```
## Customization
### Styling Posts
All Ghost post content styling is centralized in a single CSS file for easy customization:
**File**: `app/assets/css/ghost.css`
This file contains:
- **Typography styles** - Headings, paragraphs, links, lists, blockquotes, code blocks
- **Ghost card styles** - Image cards, galleries, bookmarks, toggles, callouts, videos, audio, etc.
- **CSS variables** - Colors and theme settings for both light and dark modes
- **Responsive design** - Mobile-friendly breakpoints
#### Quick Customization Examples:
**Change base font size:**
```css
/* In ghost.css, find: */
.ghost-post {
font-size: 1.8rem; /* Change this value */
}
```
**Customize colors:**
```css
/* In ghost.css, find: */
:root {
--color-primary-text: var(--color-darker-gray);
--color-secondary-text: rgb(0 0 0 / 0.55);
--ghost-accent-color: #15171a; /* Your brand color */
}
```
**Adjust content width:**
The content is wrapped in a container with `max-w-4xl` class in the post template. Edit `app/pages/posts/[slug].vue` to change the maximum width.
**Modify card styles:**
Ghost cards (like image galleries, callouts, toggles) each have their own section in `ghost.css`. Search for the card name (e.g., `.kg-image-card`, `.kg-gallery-card`) to customize.
### Other Customization Options
- **Layout**: Edit `app/layouts/default.vue` for header/footer changes
- **Components**: Modify `app/components/` for reusable elements
- **SEO**: Update meta tags in page components
### image optimization and static images
Nuxt Image is used to optimize images. It is configured in `nuxt.config.ts`.
Add the domains of your images to the `image.domains` array.
I have implemented a simple image optimization in the `useGhostContent.ts` file. It is a pre-processing step that replaces the src attribute of the img tag with the optimized URL using nuxtImage, so it is downloaded and optimized at build time.
## License
MIT
看看同类模板
对比同技术栈与用途的模板,找到更适合的视觉与内容结构。

laravel-nuxt
A Laravel-Nuxt starter kit.
Nuxt · 启动器

canvas
Portfolio template made with Nuxt 3, Nuxt Content v3, NuxtUI v3 and TailwindCSS v4
Nuxt · 作品集

nuxt3-starter
💚 A Better Nuxt 3 Starter Template,generate by nuxi.
Nuxt · 启动器

starter
Nuxt Starter Template for Nuxt UI.
Nuxt · 启动器

bloggrify
Run a blog from Markdown files. Themes, SEO, analytics, newsletter and comments preconfigured. Like Docus, but…
Nuxt · 博客

vitify-nuxt
🔽🏔 Vuetify + Nuxt Starter Template
Nuxt · 后台
