AstroBlog

astro-charm — Astro Blog Template

By Yuhanawa

astro-charm is an Astro blog theme developed by Yuhanawa, released under the MIT license, offering common blog features such as categories, tags, dark mode, search, giscus comments, and RSS.

Explore the design

Compare the page layouts and mobile experience. Open any screenshot for a closer look.

3 previews
Desktop homepage1 / 3
Desktop captureTop of page

Actual screenshot captured by the server browser.

All pages & views 3

Screenshots show visual appearance; interactive behavior may differ.

Recorded 2026-10-02View source

What stands out

A quick read of the recorded project description.

01

Provided as an Astro integration, usable in a new project or installable into an existing project

02

Built-in category pages and tag pages for organizing articles by topic

03

Supports dark mode, code blocks, and site search

04

Supports giscus comments and Google Analytics

05

Provides Sitemap and RSS output

06

Customize site information, sidebar, navigation, footer, and table of contents through configuration items

Template Details

astro-charm is an Astro theme for blog use cases, with both the repository and an online demo publicly accessible. The theme presents an editorial layout with a sidebar information area plus an article list, provides desktop and mobile pages, and includes category pages, tag pages, and representative inner pages (such as /projects).

In terms of features, the theme includes dark mode, code blocks, search, giscus comments, Google Analytics, Sitemap, and RSS, and supports customizing the site language, title, description, author, sidebar text, navigation and footer styles, table of contents (TOC), Markdown options, and giscus parameters through configuration items. The theme is integrated as an Astro integration and can be used in a new project or installed into an existing project.

Usage notes: the site field must be provided in astro.config.ts because Sitemap and RSS depend on that configuration; if image conversion errors occur, Sharp must be installed manually; if a response already sent error occurs, create a posts directory under src/content and place at least one Markdown article in it. The image on the right side of the demo site is not part of the theme itself.

AstroBlog

Is it right for your project?

Use Cases

  • Building a personal blog centered on an article list and sidebar information
  • Adding a blog theme and category, tag pages to an existing Astro project
  • Static blog sites that need dark mode, search, comments, and RSS
  • Scenarios where configuration items are used to adjust the site title, description, navigation, and footer styles

Suitable For

  • Developers using Astro who want to quickly obtain a blog theme
  • Technical blog authors who need category and tag organization
  • Users who prefer an MIT-licensed theme and want to modify the theme code themselves

Getting started & customization

Use these recorded setup notes alongside the repository instructions for your chosen version.

  1. 1

    For a new project, run pnpm create astro-theme@latest use astro-charm; for an existing project, run pnpm astro add astro-charm

  2. 2

    Merge the collections exported by astro-charm/content in src/content.config.ts

  3. 3

    The site field must be set in astro.config.ts; Sitemap and RSS depend on this field

  4. 4

    If image conversion errors occur, Sharp must be installed manually

  5. 5

    If a response already sent error occurs, create a posts directory under src/content and place at least one Markdown article in it

Read repository instructions

License & source material

Usage conditions & limitations

Free to use · keep license notice

This entry covers the free version under the MIT license in the public repository; the free scope is the code of this version and does not mean that external services or third-party assets are free.

Must comply with when using

  • Free use, modification, commercial use, and distribution of this version's code are permitted.
  • When distributing copies or substantial portions of the code, retain the original author's copyright notice and the complete MIT license notice.
  • The code is provided as is; warranties and limitations of liability are governed by the original license and applicable law.

Additional costs & items to verify

  • The comment feature depends on the third-party giscus service, and you must provide your own GitHub repository and category configuration; this is an external service dependency.
  • Enabling Google Analytics requires providing a googleAnalyticsId; this is a third-party external service and account configuration.
  • The site field must be set in astro.config.ts, otherwise Sitemap and RSS will not work properly.
  • If image conversion errors occur, the Sharp dependency must be installed manually.
  • If a response already sent error occurs, create a posts directory under src/content and place at least one Markdown article in it.
  • The image on the right side of the demo site is not part of the theme itself and should not be regarded as a resource included with the theme.
  • Demo images, fonts, icons, and other third-party assets must be checked against their respective licenses; the code's MIT license alone cannot be used to judge them.
  • External services such as domains, hosting, databases, payments, or AI may incur additional charges.
View Original Text Basis

Permission is hereby granted, free of charge

Original License Text

Comments support (giscus)

Original README

Google Analytics support

Original README

you need to add `site` to `astro.config.ts` file, because `charm` use it for `sitemap` and `rss`

Original README

Please install Sharp (`sharp`) manually into your project

Original README

Please create `posts` folder in `src\content` folder, and create a post ( `.md` file ) in it

Original README

The image on the right in the `Live Demo` is not part of the Charm theme

Original README
https://github.com/Yuhanawa/astro-charm/blob/main/LICENSEhttps://github.com/Yuhanawa/astro-charm/blob/main/README.md

Compiled by DeepSeek based on repository license and README ·2026-10-02. Results only cover the materials read; dependencies, images, fonts, and subsequent term changes are subject to their respective original texts.

Project checks & description sources

Template Information

Source platforms
GitHub
Documentation and maintenance reference score
More documented · 87 / 100
Technologies
Astro
Website type
Blog
How this score is calculated

Our heuristic uses license records (up to 30), a demo link (12), a preview (10), stars (15), recorded maintenance (15), description completeness (8), feature records (5) and classification data (5). It is not a code, security or performance test, or a Google score. A link does not establish tested functionality.

What to verify for this project

Repository update recorded
2025-11-18
Screenshot last checked
2026-10-02

A demo link is listed. Check it with your own content and viewport sizes; its presence does not confirm that forms, authentication or payments work.

The catalog identifies Astro as the primary stack. Check the actual dependency manifest and lockfile for versions and hosting requirements. These notes use recorded metadata, not a code audit or a deployment test.

Use a selection guide →

How this description was prepared

AI-assisted description based on catalog records and repository material. Repository authors are not automatically the reviewers of this description.

Automatically checked against source and license rules; no manual editorial review.

Inspect the recorded source material

SHA-256: 309540ebcb14e4928947df41be2ae4a1d50080d5ce59e957011ddf7e7388945a

2026-10-02T09:42:53.503Z

Source file / repository
# Astro Theme: Charm

[English](./README.md) | [日本語](./README-ja.md) | [中文](./README-zh-cn.md)

Beautiful, simple and easy-to-use blog theme

![Preview of Live Demo](docs/Charm-Theme-Preview-20250211.png "Charm-Theme-Preview-20250211")

[Github](https://github.com/yuhanawa/astro-charm) | [Live Demo](https://astro-charm.vercel.app/) | [PageSpeed](https://pagespeed.web.dev/analysis?url=https%3A%2F%2Fastro-charm.vercel.app%2F)

Note: The image on the right in the `Live Demo` is not part of the Charm theme

## Features

- Built with Astro v5
- Desktop and Mobile support
- High PageSpeed score
  - 100! [Report from Dec 29, 2024](https://pagespeed.web.dev/analysis/https-astro-charm-vercel-app/g1cxq98foh)
  - view new [PageSpeed](https://pagespeed.web.dev/analysis?url=https%3A%2F%2Fastro-charm.vercel.app%2F)
- Category and Tag page
- Dark mode
- Code Block
- Search
- Comments support (giscus)
- Google Analytics support
- Sitemap
- RSS
- Custom
  - [How to customize the theme](https://astro-charm.vercel.app/posts/custom)

## How to use

1. Run the following command to create a new project with `astro-charm` theme.

```bash
pnpm create astro-theme@latest use astro-charm
```

2. Add `src/content.config.ts` to your project.

```ts
import { collections as charmCollections } from "astro-charm/content";
export const collections = {
  // your other collections
  ...charmCollections,
};
```

3. Modify config and enjoy it!

Note: you need to add `site` to `astro.config.ts` file, because `charm` use it for `sitemap` and `rss`.

To learn more, see: [Config](#config)

<details>
  <summary>Install to existing project</summary>

1. Install `astro-charm` to your project.

```bash
pnpm astro add astro-charm
```

2. Modify `src/content.config.ts` file.

```ts
import { collections as charmCollections } from "astro-charm/content";
export const collections = {
  // your other collections
  ...charmCollections,
};
```

3. Modify `astro.config.ts` file.

```ts
import { defineConfig } from "astro/config";
import charm from "astro-charm";

export default defineConfig({
  prefetch: true,
  site: "<your-site-url>",

  integrations: [
    charm({
      config: {
        lang: "en", // for HTML's lang attribute and RSS
        title: "Title on home page", // for seo on home page
        description: "Description on home page", // for seo on home page
        side: {
          title: "Title",
          sub: "Sub title",
          bio: "Your bio, about 50~90 characters, automatic line wrap",
        },
        // more config
      },
    }),
  ],
});
```

</details>

## Config

You need to add `site` to `astro.config.ts` file, because `charm` use it for `sitemap` and `rss`.

### Minimal config

```ts
import { defineConfig } from "astro/config";
import charm from "astro-charm";

export default defineConfig({
  prefetch: true,
  site: "<your-site-url>",

  integrations: [
    charm({
      config: {
        lang: "en", // for HTML's lang attribute and RSS
        title: "Title on home page", // for seo on home page
        description: "Description on home page", // for seo on home page
        side: {
          title: "Title",
          sub: "Sub title",
          bio: "Your bio, about 50~90 characters, automatic line wrap",
        },
      },
    }),
  ],
});
```

### [Config schema](https://github.com/Yuhanawa/astro-charm/blob/main/package/index.ts#L59-L161)

```ts
const configSchema = z.object({
  lang: z.string(),
  title: z.string(),
  titleSuffix: z.string().or(z.boolean()).default(true),
  description: z.string().optional(),
  author: z.string().optional(),
  placeholderImage: z.string().min(1).optional(),
  licenseId: z.enum([...licenses] as [string, ...string[]]).optional(),
  rss: z.boolean().default(true),
  googleAnalyticsId: z.string().optional(),
  font: z
    .enum(["auto", "full", "only-en", "disabled", "dynamic"])
    .default("auto"),
  shootingStar: z.boolean().default(true),
  side: z.object({
    title: z.string(),
    sub: z.string(),
    bio: z.string(),
    navHome: z
      .object({
        title: z.string().default("Home"),
        link: z.string().default("/"),
        icon: iconStringOrLightDarkOrWithStates.default({
          default: "solar:file-text-broken",
          hover: "solar:file-smile-outline",
          active: "solar:file-smile-bold-duotone",
        }),
      })
      .default({}),
    footer: z
      .array(
        z.object({
          title: z.string(),
          link: z.string(),
          icon: iconStringOrLightDarkOrWithStates,
        }),
      )
      .min(1)
      .default([
        {
          title: "Twitter",
          link: "https://x.com/",
          icon: "simple-icons:twitter",
        },
        {
          title: "GitHub",
          link: "https://github.com/yuhanawa/astro-charm",
          icon: "simple-icons:github",
        },
      ]),
    navStyle: z.enum(["default", "only-icon", "only-title"]).default("default"),
    footerStyle: z
      .enum(["default", "only-icon", "only-title"])
      .default("default"),
    toc: z
      .object({
        enabled: z.boolean().optional().default(true),
        title: z.string().optional().default("Table of contents"),
        minLength: z.number().min(1).max(3).optional(),
        maxDepth: z.number().min(1).max(6).optional(),
      })
      .default({}),
  }),
  markdown: z
    .object({
      colorizedBrackets: z
        .object({
          explicitTrigger: z.boolean().default(false), // if true, ```ts colorize-brackets
        })
        .default({}),
      twoslash: z
        .object({
          explicitTrigger: z.boolean().default(true), // if true, ```ts twoslash
        })
        .default({}),
      headingAnchor: z.string().default("#"),
    })
    .default({}),
  giscus: z
    .object({
      repo: z.string(),
      repoId: z.string(),
      category: z.string(),
      categoryId: z.string(),
      mapping: z
        .enum(["pathname", "url", "title", "og:title"])
        .default("pathname"),
      strict: z.boolean().default(false),
      reactions: z.boolean().default(true),
      emitMetadata: z.boolean().default(false),
      inputPosition: z.enum(["top", "bottom"]).default("top"),
      theme: z
        .object({
          light: z.string(),
          dark: z.string(),
        })
        .default({
          light: "light",
          dark: "dark",
        }),
    })
    .optional(),
});
```

## Troubleshooting

### [CouldNotTransformImage] Could not transform image

Please install Sharp (`sharp`) manually into your project

```bash
pnpm add sharp
```

### ResponseSentError: The response has already been sent to the browser and cannot be altered.

Please create `posts` folder in `src\content` folder, and create a post ( `.md` file ) in it
The minimal md file:

```
---
title: title
published: 2025-04-10
---

```


## Questions & Suggestions

If you have any questions or suggestions, feel free to open an issue. All PRs are welcome!
Report a correction

Explore similar templates

Compare previews and descriptions within the same stack and category.