Astro博客

astro-devosfera — Astro 博客模板

作者 0xdres

基于 AstroPaper 深度定制的 Astro 博客主题,加入图库灯箱、⌘K 全局搜索、自定义字体与光标辉光等视觉与交互改动。

看看你的网站会是什么样

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

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

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

全部页面与视图 3

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

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

值得关注的模板亮点

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

01

基于 AstroPaper 深度定制,重做首页、归档、标签、搜索与文章列表页面

02

⌘K / Ctrl+K 全局搜索,由 Pagefind 静态索引驱动,支持完整键盘导航

03

图库按相册目录组织,构建时生成 srcset、WebP 与懒加载,灯箱基于原生 <dialog>

04

MDX 中可用 <GalleryEmbed> 直接嵌入图库,无需手动导入

05

可选混合信息流,把图库条目并入首页、文章页、归档、标签与 RSS

06

社交链接与编辑文章地址改为环境变量配置,未设置时自动隐藏对应链接

模板详细介绍

astro-devosfera 是一个以 AstroPaper 为基础深度定制的 Astro 博客主题,作者将其作为个人博客使用,并在 README 中说明他人使用时可删除全部内容条目并自行调整设置。主题保留了 AstroPaper 的 Markdown 类型安全、SEO(meta、Open Graph、sitemap、RSS)、明暗模式与基于 Satori 的动态 OG 图片,同时重做了首页、归档、标签、搜索与文章列表等页面。

在功能层面,主题提供 ⌘K / Ctrl+K 触发的全局搜索模态框,索引由 Pagefind 在构建时生成,因此本地开发需先执行构建才能测试搜索。图库位于 src/data/galleries/<slug>/,图片在构建时优化并输出 srcset、WebP 与懒加载,灯箱基于原生 <dialog> 实现,支持键盘导航与边缘感知的上一张/下一张控件;MDX 文章内可用 <GalleryEmbed> 嵌入图库且无需导入。此外还有可选的混合信息流,将图库条目并入首页、文章页、归档、标签与 RSS。

配置集中在 src/config.ts 的 SITE 常量与 src/constants.ts,社交链接和“编辑此文章”地址改为通过环境变量注入,未设置的变量会隐藏对应链接。主题还包含终端风格 Hero、音频播放器、玻璃拟态导航与卡片、自定义字体(Wotfard、Cascadia Code、Sriracha)以及网格、光标辉光与噪点背景。README 列出了若干上游 AstroPaper issue 的修复,但未提供性能基准或生产就绪程度的说明。

Astro博客

适合你的项目吗?

适用场景

  • 搭建以 Markdown/MDX 写作的个人博客,并希望有终端风格首页与自定义字体
  • 需要按相册整理照片,并在文章内嵌入图库、使用灯箱浏览
  • 希望站点自带静态搜索、RSS、sitemap 与动态 OG 图片等 SEO 基础能力
  • 想以 AstroPaper 为起点,在保留其结构的同时替换视觉风格与交互细节

适合人群

  • 熟悉 Astro 与 Markdown/MDX 内容组织的开发者
  • 需要图库与文章混合展示的个人站点作者
  • 愿意通过 src/config.ts 与环境变量自行完成配置的用户

上手与定制指南

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

  1. 1

    需要 Node.js 20+ 与 pnpm,安装依赖后运行 pnpm run dev 启动本地开发服务器

  2. 2

    Pagefind 搜索索引仅在构建时生成,本地测试搜索需先 pnpm run build 再 preview 或 dev

  3. 3

    复制 .env.example 为 .env 并填写社交链接等变量,未设置的变量会隐藏对应链接

  4. 4

    文章放在 src/data/blog/,图库放在 src/data/galleries/<slug>/,站点配置集中在 src/config.ts

  5. 5

    提供 Docker 构建方式:docker build -t devosfera-blog . 后映射端口运行

查看仓库使用说明

授权与来源资料

使用条件与限制

免费使用 · 保留许可声明

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

使用时需要遵守

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

额外费用与待核对事项

  • Pagefind 搜索索引仅在构建产物中生成,本地开发环境无法直接测试搜索功能,需先执行构建再预览或开发。
  • 社交链接与编辑文章地址等通过环境变量注入,使用前需复制 .env.example 为 .env 并填写自己的值,未设置的变量会隐藏对应链接。
  • 运行项目需要 Node.js 20 及以上版本并安装 pnpm 包管理器。
  • 演示图片、字体、图标及其他第三方素材需按各自许可核对,不能仅凭代码的 MIT 许可判断。
  • 域名、托管、数据库、支付或 AI 等外部服务可能另外收费。
查看原文依据

Permission is hereby granted, free of charge

许可证原文

The Pagefind search index is **only available in the production build**.

README 原文

Copy `.env.example` → `.env` and fill in your own values before running the project.

README 原文

**Requirements:** Node.js 20+ and pnpm.

README 原文
https://github.com/0xdres/astro-devosfera/blob/main/LICENSEhttps://github.com/0xdres/astro-devosfera/blob/main/README.md

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

项目核对记录与介绍依据

模板资料

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

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

这个项目需要核对什么

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

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

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

查看具体选型方法 →

介绍的制作与核对状态

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

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

查看当时使用的来源资料

SHA-256: 0edabc5d94d409f08ea20c2b94de0751dbea68025b16b8645ef448887dc6911c

2026-10-01T13:28:56.214Z

来源文件 / 仓库
# Devosfera Blog

Heavily customized version of the [AstroPaper](https://github.com/satnaing/astro-paper) theme with a new aesthetic, image galleries, global search modal, and dozens of visual and interactive improvements.

**🌐 Live demo:** [devosfera.vercel.app](https://devosfera.vercel.app)

![Devosfera OG](public/devosfera-og.webp)

> **Note:** This project is primarily my personal blog. If anyone wishes to use it, feel free to delete all entries and edit the settings freely.

> [!IMPORTANT]
> **Social links and personal URLs are no longer hardcoded.**
> They are loaded from environment variables so that forks of this repo do not expose the original author's personal data.
> Copy `.env.example` → `.env` and fill in your own values before running the project. See the [Configuration](#%EF%B8%8F-configuration) section for details.

---

## Table of contents

1. [Features](#-features)
2. [Project structure](#-project-structure)
3. [Installation and local development](#-installation-and-local-development)
4. [Commands](#-commands)
5. [Creating content](#-creating-content)
   - [Posts](#posts-srcdatablog)
   - [Image galleries](#galleries-srcdatagalleries)
6. [GalleryEmbed component](#%EF%B8%8F-galleryembed-component)
7. [Configuration](#%EF%B8%8F-configuration)
8. [Upstream issues resolved](#-upstream-issues-resolved)
9. [License](#-license)

---

## ✨ Features

### Core (inherited from AstroPaper)

- Type-safe Markdown, good performance, accessible and responsive
- Full SEO (meta tags, Open Graph, sitemap, RSS), light/dark mode
- Dynamically generated OG images with Satori

### Modern design

- Hero with animated prompt configurable from `heroTerminalPrompt` in `src/config.ts` (default: `~/ready-to-go $`)
- Global backdrop: grid + cursor glow + noise texture (all pages) optional and configurable from `src/config.ts`
- Glassmorphism on navbar, cards and modals

### Custom typography

| Role          | Font                      |
| :------------ | :------------------------ |
| Body          | `Wotfard` (local)         |
| Code / Mono   | `Cascadia Code` (local)   |
| Italics / H3  | `Sriracha` (Local) |

### Global search (⌘K)

- Modal via `⌘K` / `Ctrl+K` powered by **Pagefind** (static index) and full keyboard navigation (if you want to test it locally, run `pnpm run build` first and after that `pnpm run dev` or `pnpm run preview` since the index is only generated in production)

### Image galleries (`/galleries`)

- Albums in `src/data/galleries/<slug>/`; images optimized at build-time (srcset, WebP, lazy)
- Native lightbox with `<dialog>`, redesigned fullscreen layout, keyboard navigation and edge-aware prev/next controls
- `<GalleryEmbed>` to embed galleries inside MDX posts without importing
- Controlled by `showGalleries` in `src/config.ts` (also gates gallery inclusion in mixed feeds) — see [GALLERIES.md](GALLERIES.md)

### Unified mixed feed (posts + galleries)

- Optional mixed feed controlled by `showGalleriesInIndex` in `src/config.ts` (effective only if `showGalleries` is `true`)
- When both flags are enabled, gallery entries are included in `/`, `/posts`, `/archives`, `/tags`, and `/rss.xml`
- Shared URL/date helpers keep routing and publish-date sorting consistent across all listing pages
- Gallery entries include a visual badge in cards and archive timeline items

### Performance and maintainability improvements

- Parallel collection loading in key routes using `Promise.all`
- Optimized sorting and tag extraction logic for larger content sets
- Stronger shared typing across blog/gallery entries (removed weak `any` usage)
- Reduced duplicated route/slug logic by centralizing entry helpers

### Branded audio player

- Intro audio player in the hero with terminal aesthetic (wave bars, progress bar)
- Fully togglable and configurable from `src/config.ts`

### Redesigned pages

| Page        | Highlights                                          |
| :---------- | :-------------------------------------------------- |
| `/` Home    | Terminal hero, featured grid, section counters, optional mixed feed |
| `/archives` | Vertical timeline with glow, includes gallery entries |
| `/tags`     | Grid with proportional progress bar                 |
| `/search`   | Reactive aurora, restyled Pagefind                  |
| Posts       | Paginated mixed feed (posts + galleries), inline Pagefind search |

---

## 🚀 Project structure

```
/
├── public/
│   ├── audio/             # Audio files (intro, etc.)
│   └── pagefind/          # Search index (generated at build)
├── src/
│   ├── assets/            # Local fonts, SVG icons and logo
│   ├── components/        # Reusable Astro components
│   ├── data/
│   │   ├── blog/          # Posts .md / .mdx
│   │   └── galleries/     # Galleries (one folder per album)
│   ├── layouts/           # Root layout, PostDetails, etc.
│   ├── pages/             # Astro routes
│   ├── styles/            # global.css, typography.css
│   └── utils/             # Filters, OG with Satori, Shiki transformers
└── astro.config.ts
```

---

## 👨🏻‍💻 Installation and local development

**Requirements:** Node.js 20+ and pnpm.

```bash
# 1. Install dependencies
pnpm install

# 2. Development server
pnpm run dev
# → http://localhost:4321
```

The Pagefind search index is **only available in the production build**. To test it locally:

```bash
pnpm run build && pnpm run preview/dev
```

### Docker

```bash
docker build -t devosfera-blog .
docker run -p 4321:80 devosfera-blog
```

---

## 🧞 Commands

| Command            | Action                                                   |
| :----------------- | :------------------------------------------------------- |
| `pnpm install`     | Install dependencies                                     |
| `pnpm run dev`     | Local dev server at `localhost:4321`                     |
| `pnpm run build`   | Production build (`astro check` + build + Pagefind)      |
| `pnpm run preview` | Preview the production build                             |
| `pnpm run format`  | Format with Prettier                                     |
| `pnpm run lint`    | Lint with ESLint                                         |

> `pnpm run build` internally runs `pagefind --site dist && cp -r dist/pagefind public/`. The search index ends up in `public/pagefind/` ready for preview.

---

## 📝 Creating content

### Posts (`src/data/blog/`)

Create a `.md` or `.mdx` file with the following frontmatter:

```yaml
---
title: "Post title"
pubDatetime: 2026-01-15T10:00:00Z   # required — ISO 8601 with timezone
description: "Short description for SEO and cards"
tags: ["astro", "dev"]
featured: false       # highlight on the home page
draft: false          # hidden in production
timezone: "America/Guatemala"  # overrides SITE.timezone
hideEditPost: false
---
```

**MDX**: JSX components can be used directly. `<GalleryEmbed>` is available without importing it (see next section).

**Table of Contents**: add `## Table of contents` to the post body to auto-generate the TOC with `remark-toc` + `remark-collapse`.

**Annotated code blocks** (via Shiki transformers):

```
// [!code highlight]      → highlight the line
// [!code ++]             → added line (diff)
// [!code --]             → removed line (diff)
// fileName: file.ts      → display the filename above the block
```

---

### Galleries (`src/data/galleries/`)

Quick setup:

1. Create a folder in `src/data/galleries/<slug>/`.
2. Add `index.md` (gallery metadata) and image files.
3. Use numeric prefixes (`01-`, `02-`, …) if you want to control image order.
4. The folder slug becomes the route: `/galleries/<slug>`.

For full details (frontmatter fields, cover behavior, alt generation, and image optimization), see [GALLERIES.md](GALLERIES.md).

---

## 🖼️ GalleryEmbed component

Embed a gallery inside any `.mdx` post — **no import needed**:

```mdx
<GalleryEmbed slug="my-trip-to-tokyo" />
```

Optional props: `limit` (`0` = all), `cols` (`2 | 3 | 4`), `showLink` (`true/false`).

For advanced usage, full props reference, lightbox behavior, and invalid slug fallback, see [GALLERIES.md](GALLERIES.md#galleryembed--gallery-inside-mdx-posts).

---

## ⚙️ Configuration

All site configuration lives in `src/config.ts` (the `SITE` constant). It includes general settings (title, description, timezone), feature toggles (galleries, audio player, mixed feed), and content limits (posts per page, gallery embed limit).

Social links and "Share" links are defined in `src/constants.ts`.

> [!WARNING]
> **Breaking change — social links moved to environment variables.**
>
> Previously, social URLs (GitHub, X, LinkedIn, email) and the "Edit this post" URL were hardcoded in `src/constants.ts` and `src/config.ts`. This caused every fork of the repo to expose the original author's personal data publicly, leading to unwanted spam.
>
> **What changed:**
>
> | Variable | What it controls |
> | :--- | :--- |
> | `PUBLIC_SOCIAL_GITHUB` | GitHub profile link & JSON-LD author URL |
> | `PUBLIC_SOCIAL_X` | X / Twitter profile link |
> | `PUBLIC_SOCIAL_LINKEDIN` | LinkedIn profile link |
> | `PUBLIC_SOCIAL_EMAIL` | Contact email (shown as `mailto:` link) |
> | `PUBLIC_EDIT_POST_URL` | "Edit this post" button base URL |
>
> **To restore your socials after forking or updating:**
>
> ```bash
> cp .env.example .env
> # fill in your own values in .env
> ```
>
> For production deployments (Vercel, Netlify, etc.), add these variables in your platform's environment settings.
> Any variable left **unset** simply hides that social link — no errors, no broken UI.

---

## 🐛 Upstream issues resolved

Bugs and feature requests from the official [AstroPaper](https://github.com/satnaing/astro-paper) repository implemented in this version:

| Issue                                                      | Description                                                                                                                                                                                                             | Files                                        | Credits                                                                                                                                                   |
| :--------------------------------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [#614](https://github.com/satnaing/astro-paper/issues/614) | **Back to Top shifts the pagination button** when `ShareLinks` is empty                                                                                                                                                 | `BackToTopButton.astro`                      | —                                                                                                                                                         |
| [#574](https://github.com/satnaing/astro-paper/issues/574) | **Markdown tables overflow the layout on mobile** — fixed with `w-full table-auto` and `word-wrap` on cells                                                                                                             | `typography.css`                             | [@GladerJ](https://github.com/GladerJ) — [solution](https://github.com/satnaing/astro-paper/issues/574#issuecomment-3427381261)                           |
| [#569](https://github.com/satnaing/astro-paper/issues/569) | **Back to Top inconsistent on desktop** — unified circular design with progress ring and `fixed` positioning                                                                                                            | `BackToTopButton.astro`, `PostDetails.astro` | —                                                                                                                                                         |
| [#566](https://github.com/satnaing/astro-paper/issues/566) | **Share links don't open in a new tab** — added `target="_blank"` and `rel="noopener noreferrer"`                                                                                                                       | `ShareLinks.astro`                           | [PR #611](https://github.com/satnaing/astro-paper/pull/611) by [@zerone0x](https://github.com/zerone0x)                                                   |
| [#131](https://github.com/satnaing/astro-paper/issues/131) | **No MDX support** — added `@astrojs/mdx` integration with `extendMarkdownConfig: true`                                                                                                                                | `astro.config.ts`, `content.config.ts`       | —                                                                                                                                                         |
| [#495](https://github.com/satnaing/astro-paper/issues/495) | **Inconsistent post filtering by timezone** — fixed using `dayjs` + `utc`/`timezone` plugins; also fixed a bug in the reference solution that used `.millisecond()` instead of `.valueOf()`                            | `postFilter.ts`                              | [@kj-9](https://github.com/kj-9) — [reference fix](https://github.com/satnaing/astro-paper/compare/main...kj-9:astro-paper:fix-post-filter-date)          |
| [#553](https://github.com/satnaing/astro-paper/issues/553) | **No galleries section** — implemented full `/galleries` section with lightbox, `GalleryEmbed`, image optimization and `showGalleries` flag. See [GALLERIES.md](GALLERIES.md)                                           | multiple — see GALLERIES.md                  | —                                                                                                                                                         |

---

## 📜 License

Based on [AstroPaper](https://github.com/satnaing/astro-paper) by [Sat Naing](https://satnaing.dev), licensed under MIT.
Customizations © [0xdres](https://github.com/0xdres).
反馈内容错误

看看同类模板

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