Astro博客

astro-sakura-blog — Astro 博客模板

作者 HuanNan520

基于 Astro 的樱花主题博客模板,含内置音乐播放器、深浅色模式与客户端全文搜索。

看看你的网站会是什么样

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

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

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

全部页面与视图 3

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

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

值得关注的模板亮点

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

01

樱花主题视觉,含玻璃拟态、渐变强调色与过渡动画

02

内置音乐播放器:播放列表、双语歌词同步、拖动位置、MediaSession API

03

深浅色模式,支持按时间自动切换与手动切换

04

Fuse.js 客户端全文搜索,无需后端

05

系列文章自动前后篇导航,文章 frontmatter 可设单篇背景音乐

06

SEO 输出包含 JSON-LD、OpenGraph、Twitter Cards 与 sitemap

模板详细介绍

astro-sakura-blog 是一个用 Astro 与 Tailwind CSS 构建的博客模板,视觉上采用樱花主题,配合玻璃拟态、渐变强调色和过渡动画。站点信息集中在 src/config.ts,文章以 .md 或 .mdx 放在 src/content/blog/ 下,通过 frontmatter 配置标题、摘要、日期、封面、标签、系列与单篇背景音乐。

功能方面,模板内置自定义音乐播放器,支持播放列表、双语歌词同步、Apple Music 风格模糊、拖动位置以及 MediaSession API(键盘媒体键与系统通知);播放列表与歌词数据写在 src/data/playlist.ts,音频放在 public/music/,封面放在 public/images/covers/,未配置歌曲时显示空状态。此外提供深浅色模式(可按时间自动切换并支持手动切换)、基于 Fuse.js 的客户端全文搜索、Astro 内置路由的视图过渡、系列文章的自动前后篇导航、可选的 Waline 评论、自动生成的 RSS、JSON-LD/OpenGraph/Twitter Cards/sitemap 等 SEO 输出、移动端底部导航、阅读进度条、代码块一键复制和图片灯箱。

使用限制:评论依赖外部 Waline 服务,需要自行部署并填写 serverURL,留空则关闭;演示图片、字体、图标等第三方素材需按各自许可核对,代码本身采用 MIT 许可。

Astro博客

适合你的项目吗?

适用场景

  • 搭建个人博客并希望自带音乐播放与歌词展示
  • 需要按系列组织文章并自动生成前后篇导航
  • 希望用客户端搜索替代服务端搜索的静态站点
  • 需要深浅色模式、RSS 与基础 SEO 元数据的博客

适合人群

  • 使用 Astro 的个人博客作者
  • 偏好樱花/柔和视觉风格的内容站点
  • 需要内置音乐播放器的写作站点
  • 接受评论依赖外部 Waline 服务的用户

上手与定制指南

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

  1. 1

    克隆仓库后执行 npm install,用 npm run dev 启动开发服务器,npm run build 构建生产版本

  2. 2

    在 src/config.ts 中配置站点名称、描述、URL、语言、作者信息、社交链接、评论与统计等

  3. 3

    文章写入 src/content/blog/,使用 .md 或 .mdx 并通过 frontmatter 设置标题、摘要、日期、封面、标签、系列与 bgm

  4. 4

    音乐播放器数据在 src/data/playlist.ts 配置,MP3 放入 public/music/,封面放入 public/images/covers/

  5. 5

    评论需自行部署 Waline 并在 config.ts 填写 serverURL,留空即关闭评论

查看仓库使用说明

授权与来源资料

使用条件与限制

免费使用 · 保留许可声明

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

使用时需要遵守

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

额外费用与待核对事项

  • 演示图片、字体、图标及其他第三方素材需按各自许可核对,不能仅凭代码的 MIT 许可判断。
  • 域名、托管、数据库、支付或 AI 等外部服务可能另外收费。
  • 评论功能依赖外部 Waline 服务,需自行部署并在 src/config.ts 中填写 serverURL;不部署或留空则无法使用评论。
  • 评论为可选功能,将 serverURL 留空即关闭评论,不影响模板其他部分使用。
查看原文依据

Permission is hereby granted, free of charge

许可证原文

1. Set up [Waline](https://waline.js.org) (free hosting on Vercel) 2. Add your server URL in `src/config.ts`

README 原文

Leave `serverURL` empty to disable comments.

README 原文
https://github.com/HuanNan520/astro-sakura-blog/blob/main/LICENSEhttps://github.com/HuanNan520/astro-sakura-blog/blob/main/README.md

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

项目核对记录与介绍依据

模板资料

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

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

这个项目需要核对什么

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

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

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

查看具体选型方法 →

介绍的制作与核对状态

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

审核声明: [email protected] · 2026-10-05

查看当时使用的来源资料

SHA-256: f80edf1a526b6e81bf3fb80d613fb6b5576eaa87d577d1c43f672c639a7586a5

2026-10-05T00:12:39.418Z

来源文件 / 仓库
# Astro Sakura Blog

[![Astro](https://img.shields.io/badge/Astro-6-ff5d01?logo=astro&logoColor=white)](https://astro.build)
[![Tailwind CSS](https://img.shields.io/badge/Tailwind_CSS-v3-06B6D4?logo=tailwindcss&logoColor=white)](https://tailwindcss.com)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)

A beautiful, feature-rich blog template built with Astro 6 and Tailwind CSS, featuring a cherry blossom aesthetic and a built-in music player.

[**Live Demo**](https://huannan.top)

![Homepage](screenshots/homepage.png)

<details>
<summary>More Screenshots</summary>

### Dark Mode
![Dark Mode](screenshots/dark-mode.png)

### Blog List
![Blog](screenshots/blog.png)

### Article Page
![Article](screenshots/article.png)

### Mobile
<img src="screenshots/mobile.png" width="390" alt="Mobile" />

</details>

## Features

- **Cherry Blossom Theme** — Sakura-inspired design with glassmorphism, gradient accents, and smooth animations
- **Built-in Music Player** — Custom player with playlist, bilingual lyrics sync, Apple Music-style blur, drag-to-move, and MediaSession API (keyboard media keys, system notifications)
- **Dark / Light Mode** — Automatic time-based switching (dark after 18:00), manual toggle
- **Full-text Search** — Client-side search powered by Fuse.js
- **View Transitions** — Smooth page transitions via Astro's built-in router
- **Series Navigation** — Group related posts with automatic prev/next links
- **Per-article BGM** — Set background music per blog post via frontmatter
- **Comments** — Optional Waline integration
- **RSS Feed** — Auto-generated
- **SEO Optimized** — JSON-LD, OpenGraph, Twitter Cards, sitemap
- **Mobile Responsive** — Bottom navigation bar, touch-friendly player
- **Reading Progress Bar** — Visual scroll indicator
- **Code Block Copy** — One-click copy on code blocks
- **Image Lightbox** — Click to zoom images

## Quick Start

```bash
# Clone the repo
git clone https://github.com/HuanNan520/astro-sakura-blog.git
cd astro-sakura-blog

# Install dependencies
npm install

# Start dev server
npm run dev

# Build for production
npm run build
```

## Configuration

All site settings live in a single file: **`src/config.ts`**

```typescript
export const siteConfig = {
  name: "My Blog",                    // Site title
  description: "My personal blog",   // SEO description
  url: "https://myblog.com",         // Your deployed URL
  language: "en",                    // "en" | "zh-CN" | "ja"

  author: {
    name: "Your Name",
    tagline: "Writer / Developer",
    avatar: "/images/avatar.png",
    motto: "Your favorite quote.",
  },

  // ... hero, quotes, projects, social links, comments, analytics
};
```

See `src/config.ts` for the full reference with comments.

## Writing Posts

Create `.md` or `.mdx` files in `src/content/blog/`:

```yaml
---
title: "My Post Title"
summary: "A brief summary"
date: 2026-01-01
cover: "../../assets/images/covers/cover-1.webp"  # optional
tags: ["Tag1", "Tag2"]
bgm: "Song Name"           # optional: auto-play this song
series: "Series Name"       # optional: group posts
seriesOrder: 1              # optional: order in series
---

Your content here...
```

## Music Player

Add songs to **`src/data/playlist.ts`**:

```typescript
export const instrumental: Song[] = [
  { name: 'Track Name', artist: 'Artist', url: '/music/track.mp3', cover: '/images/covers/cover.webp' },
];

export const vocal: Song[] = [];

export const lyrics: Record<string, LyricLine[]> = {
  'Track Name': [
    { time: 0.0, ja: '(Intro)', zh: '' },
    { time: 15.0, ja: 'First lyric line', zh: 'Translation' },
  ],
};
```

Place MP3 files in `public/music/` and cover images in `public/images/covers/`.

The player works with zero songs configured — it shows a friendly empty state.

## Comments

1. Set up [Waline](https://waline.js.org) (free hosting on Vercel)
2. Add your server URL in `src/config.ts`:
   ```typescript
   comments: { serverURL: "https://your-waline.vercel.app" }
   ```

Leave `serverURL` empty to disable comments.

## Deployment

### Cloudflare Pages

1. Push to GitHub
2. Connect repo in Cloudflare Pages dashboard
3. Build command: `npm run build`
4. Output directory: `dist`

### Vercel / Netlify

Zero-config — just connect your repo.

## Tech Stack

- [Astro 6](https://astro.build) — Static site generator
- [Tailwind CSS v3](https://tailwindcss.com) — Utility-first CSS
- [MDX](https://mdxjs.com) — Markdown with components
- [Fuse.js](https://www.fusejs.io) — Fuzzy search
- Self-hosted fonts: Manrope + Noto Serif SC

## Project Structure

```
src/
├── config.ts              # All site configuration
├── data/playlist.ts       # Music player data
├── layouts/Base.astro     # Main layout
├── pages/
│   ├── index.astro        # Homepage
│   ├── blog/              # Blog listing & posts
│   ├── projects.astro     # Projects showcase
│   ├── about.astro        # About page
│   ├── tags.astro         # Tag cloud
│   └── archives.astro     # Post archive
├── components/
│   ├── MusicPlayer.astro  # Built-in music player
│   ├── Footer.astro
│   └── ...
├── content/blog/          # Your blog posts (.md/.mdx)
└── styles/global.css      # Global styles
```

## License

MIT
反馈内容错误

看看同类模板

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