Astro博客

astro-theme-typography — Astro 博客模板

作者 moeyua

基于 Astro 的排版向博客主题,由 hexo-theme-Typography 重写而来,支持深色模式、i18n 与多种评论服务。

看看你的网站会是什么样

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

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

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

全部页面与视图 3

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

采集于 2026-09-30查看来源

值得关注的模板亮点

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

01

使用 Astro、TypeScript 与 UnoCSS 构建

02

排版规则参考常见中文排版规范,面向阅读体验

03

内置深色模式,可选 light、dark 或跟随系统

04

支持 en-us、zh-cn、zh-tw、ja-jp、it-it 多语言

05

可接入 Disqus、Giscus、Twikoo 评论服务

06

提供 Open Graph、Twitter Cards、Sitemap 与 RSS feed

模板详细介绍

Typography 是一个用 Astro、TypeScript 和 UnoCSS 构建的博客主题,作者为 moeyua,仓库采用 MIT 许可。它由 hexo-theme-Typography 重写而来,定位在排版与阅读体验上,README 称其排版规则源自常见的中文排版规范。

主题提供文章、归档、分类、关于等默认导航,文章以 Markdown 文件形式放在 src/content/posts 下,通过 frontmatter 填写标题、发布日期、分类和描述等元数据,也可以使用 pnpm theme:create 命令创建新文章。站点配置分为默认配置 src/.config/default.ts 与用户覆盖配置 src/.config/user.ts,社交链接、导航项、主题样式、语言和评论服务都在配置文件中设置。

功能方面,主题内置深色模式(light、dark、system 三选一)、i18n 多语言(自带 en-us、zh-cn、zh-tw、ja-jp、it-it,可在 src/i18n.ts 中扩展)、Open Graph 与 Twitter Cards、Sitemap 和 RSS feed,并支持 Disqus、Giscus、Twikoo 三种评论服务,同时配置多个时只显示第一个。README 的 TODO 中列出 WebSub、搜索和分析尚未完成,说明这些能力当前不在主题内。

使用上的限制:社交图标名称需对应 Material Design Icons 中的图标名;修改配置后需要重启开发服务器才能看到变化;演示图片、字体、图标等第三方素材需按各自许可单独核对,MIT 许可只覆盖该版本代码。

Astro博客

适合你的项目吗?

适用场景

  • 搭建以长文阅读为主的个人博客
  • 需要中文排版细节与多语言切换的站点
  • 希望通过配置文件调整导航、社交链接与主题样式
  • 使用 Markdown 写作并需要分类、归档页面的博客

适合人群

  • 使用 Astro 的开发者或愿意按文档配置的博客作者
  • 重视排版与阅读体验的中文内容站点
  • 需要深色模式、RSS 与 Sitemap 的个人博客
  • 希望接入 Giscus 等评论服务的静态站点

上手与定制指南

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

  1. 1

    可 Fork 仓库后通过 Vercel 或 Netlify 导入部署,也可参考 Astro 部署文档选择其他平台

  2. 2

    在 src/content/posts 新建 Markdown 文件撰写文章,frontmatter 需包含 title、pubDate、categories、description 等字段

  3. 3

    配置写在 src/.config/user.ts 中覆盖 src/.config/default.ts 的默认值,修改后需重启开发服务器

  4. 4

    社交图标 name 使用 Material Design Icons 的图标名,导航项需在 src/pages 中补充对应页面

  5. 5

    评论服务同时配置多个时只显示第一个,第三方素材与外部服务需单独确认许可与费用

查看仓库使用说明

授权与来源资料

使用条件与限制

免费使用 · 保留许可声明

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

使用时需要遵守

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

额外费用与待核对事项

  • 修改配置(如社交链接等)后需重启开发服务器才能生效。
  • 同时配置多个评论服务时,仅第一个生效,其余不会显示。
  • 社交链接的 name 必须使用 Material Design Icons 中的图标名,否则无法正确生成图标。
  • 内置语言仅 en-us、zh-cn、zh-tw、ja-jp、it-it,如需其他语言须自行在 src/i18n.ts 中扩展。
  • WebSub、搜索与分析功能尚未实现,当前版本不包含这些能力。
  • 更新主题需在 Fork 仓库执行 Sync Fork,且不可点击 Discard Changes,否则会丢失本地改动。
  • 评论功能依赖 Disqus、Giscus 或 Twikoo 等第三方外部服务,可能需要额外账号或自建服务。
  • 演示图片、字体、图标及其他第三方素材需按各自许可核对,不能仅凭代码的 MIT 许可判断。
  • 域名、托管、数据库、支付或 AI 等外部服务可能另外收费。
查看原文依据

Permission is hereby granted, free of charge

许可证原文

Note that you need to restart the development server to see the changes.

README 原文

when you fill in multiple comment services, only the first service will be displayed.

README 原文

The `name` is the icon name in [Material Design Icons](https://pictogrammers.com/library/mdi/),

README 原文

You can see all supported languages in [src/i18n.ts](src/i18n.ts), and add more if you need.

README 原文

- [ ] WebSub - [x] comment - [ ] search - [ ] analytics

README 原文

You can simply [`Sync Fork`](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork) on your own forked project (do not click Discard Changes, otherwise you will lose your own changes).

README 原文

Support Disqus, Giscus, Twikoo as comment service.

README 原文
https://github.com/moeyua/astro-theme-typography/blob/main/LICENSEhttps://github.com/moeyua/astro-theme-typography/blob/main/README.md

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

项目核对记录与介绍依据

模板资料

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

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

这个项目需要核对什么

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

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

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

查看具体选型方法 →

介绍的制作与核对状态

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

已完成服务器许可规则与 AI 来源核对;未经过人工编辑审核。

查看当时使用的来源资料

SHA-256: 70ce9db9aa3a65582ad23b151068fbb1757fd4e63c468004866d0b7dfe01a624

2026-10-01T15:15:31.493Z

来源文件 / 仓库
# Typography

<p align='center'>
  <img src='./public/typograph-og.jpg' alt='Typography' width='600'/>
</p>

<h6 align='center'>
<a href="https://astro-theme-typography.vercel.app/">Live Demo</a>
</h6>
<h5 align='center'>
<b>This work is rewrite from <a href="https://github.com/sumimakito/hexo-theme-typography">hexo-theme-Typography</a></b>
</h5>
<p align='center'>
<b>English</b> | <a href="./README.zh-CN.md">简体中文</a>
</p>

## Features

- Build with **Astro**, **TypeScript** and **UnoCSS**
- **Fast**. 100% [Pagespeed Score](https://pagespeed.web.dev/analysis/https-astro-theme-typography-vercel-app/j34nq9tx0s?form_factor=desktop).
- **Typography** Derived from prevalent Chinese typographic norms and aims to provide an enhanced reading experience for website visitors.
- **Responsive**. Responsive and works well on all screen sizes.
- **Accessible**. A well thought out semantic and accessible content.
- **SEO friendly**.Open Graph and Twitter Cards support for a better social sharing experience.
- **Sitemap** and **RSS feed** for search engines.
- i18n support.
- Support Disqus, Giscus, Twikoo as comment service.
- Dark mode support.

## Demo

> Submit a PR to add your blog Demo.

- [Live Demo](https://astro-theme-typography.vercel.app/)
- [My Blog](https://blog.moeyua.com/)
- [Julyfun's Blog (how to fully build this blog using `bun` in minutes)](https://julyfun.fun/posts/%E5%85%89%E9%80%9F%E6%90%AD%E5%BB%BA%E8%BF%99%E6%A0%B7%E4%B8%80%E4%B8%AA%E5%8D%9A%E5%AE%A2/)
- [Jinx's Blog](https://blog.mytest.cc/)
- [Unconventional Reading Notes](https://books.beyondxin.top/)

## Getting Started

Typography is a minimal, responsive and SEO-friendly Astro blog theme. This guide will help you get started with a new project.

### Quick Start

You can fork the repository to your account by clicking the Fork button in the upper right corner, click the button below, select the repository you just forked, click the Import button, and you will be taken to the project configuration page.

[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new)
[![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start)

Or you can refer to the [Astro](https://docs.astro.build/guides/deploy/) documentation to deploy to your favorite platform.

### Add post

You can add content by creating a new markdown file in `src/content/posts`. The file need metadata in the frontmatter, like this:

```md
---
title: title
pubDate: 2021-08-01
categories: ["article"]
description: "description"
---
```

Or, you can use the following command in your terminal to create a new post:

```bash
pnpm theme:create
```

## Updating the theme

You can simply [`Sync Fork`](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork) on your own forked project (do not click Discard Changes, otherwise you will lose your own changes).

## Customization

Typography is highly customizable. The default configuration file is [src/.config/default.ts](src/.config/default.ts), you can override the default configuration in [src/.config/user.ts](src/.config/user.ts) as needed.

### Social links

Typography has built-in support for adding links to your social media accounts to the site via the social option in the config file:

```ts
socials: [
  {
    name: 'github',
    href: 'https://github.com/moeyua/astro-theme-typography'
  }
]
```

The `name` is the icon name in [Material Design Icons](https://pictogrammers.com/library/mdi/),
which will be automatically generated as the icon.

> Note that you need to restart the development server to see the changes.

### Navigation links

By default, the navigation are `Posts`, `Archive`, `Categories` and `About`. You can add more in the config file:

```ts
{
  navs: [
    {
      name: 'Categories',
      href: '/categories'
    }
  ]
}
```

And then add the corresponding page in `src/pages`, see more in [Astro Pages](https://docs.astro.build/en/core-concepts/astro-pages/)

### Dark mode

Typography supports dark mode. You can change it in the config file:

```ts
themeStyle: 'dark' // 'light' | 'dark' | 'system'
```

### Internationalization (i18n)

Typography provides built-in support for multilingual sites. By default, the language is `en-us`, you can change it in the config file:

```ts
locale: 'zh-cn'
```

For now, Typography supports below languages:

- `en-us`
- `zh-cn`
- `zh-tw`
- `ja-jp`
- `it-it`

You can see all supported languages in [src/i18n.ts](src/i18n.ts), and add more if you need.

### Comment

Typography supports multiple comment services, currently supports [Disqus](https://disqus.com/), [Giscus](https://giscus.app/) and [Twikoo](https://twikoo.js.org/).

Enable the corresponding comment service by adding the configuration to the config file, when you fill in multiple comment services, only the first service will be displayed.

#### Disqus

You can enable Disqus by adding the following configuration to the config file:

```ts
comments: {
  disqus: {
    shortname: 'your-disqus-shortname'
  }
}
```

#### Giscus

Based on the [Giscus web component](https://github.com/giscus/giscus-component?tab=readme-ov-file#using-the-web-component) implementation.

The prop names are the same as the data- attributes shown on the [giscus website](<(https://giscus.app/)>), but written in camelCase with the data- prefix and dashes removed.

You can enable Giscus by adding the following configuration to the config file:

```ts
{
  comments: {
    giscus: {
      repo: 'moeyua/astro-theme-typography'
      repoId: 'R_kgDOKy9HOQ'
      category: 'General'
      categoryId: 'DIC_kwDOKy9HOc4CegmW'
      mapping: 'title'
      strict: '0'
      reactionsEnabled: '1'
      emitMetadata: '1'
      inputPosition: 'top'
      theme: 'light'
      lang: 'zh-CN'
      loading: 'lazy'
    }
  }
}
```

#### Twikoo

You can enable Twikoo by adding the following configuration to the config file:

```ts
{
  comments: {
    twikoo: {
      envId: 'your-env-id'
    }
  }
}
```

## Pagespeed Score

[![Pagespeed Score](https://github.com/moeyua/astro-theme-typography/assets/45156493/2272f576-d6ff-49ef-a294-5c2acf365907)](https://pagespeed.web.dev/analysis/https-astro-theme-typography-vercel-app/j34nq9tx0s?form_factor=desktop)

## TODO

- [ ] WebSub
- [x] comment
- [ ] search
- [ ] analytics
反馈内容错误

看看同类模板

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