Skip to content
Souloss
Go back

How to configure astro-minimax theme

How you can make astro-minimax theme absolutely yours.

astro-minimax is a highly customizable Astro blog theme. With astro-minimax, you can customize everything according to your personal taste. This article will explain how you can make some customizations easily in the config file.

Path note: If you’re using the GitHub Template method, the config file is at apps/blog/src/config.ts. For NPM package integration, it’s at src/config.ts in your project root.

Configuring SITE

The main configuration resides in the SITE object in src/config.ts. Here’s the full configuration example:

Basic Configuration

OptionDescription
websiteYour deployed website URL. Critical for SEO, canonical URLs, and social cards
authorYour name
profileYour personal/portfolio website URL for better SEO. Set to "" if you don’t have one
descSite description for SEO and social media sharing
titleYour site name
ogImageDefault OG image (place in public/ directory or use an external URL)
postPerIndexNumber of posts shown in the “Recent Posts” section on the home page
postPerPageNumber of posts displayed per page in paginated lists
scheduledPostMarginGrace period for scheduled posts (in milliseconds), default 15 minutes
showBackButtonWhether to show a back button in post detail pages
startDateBlog start date, used for the archives timeline
dynamicOgImageWhether to auto-generate dynamic OG images for posts without an ogImage
dirText direction: ltr (left-to-right) / rtl (right-to-left) / auto
langDefault language code (en, zh, etc.)
timezoneTimezone in IANA format, ensures consistent timestamps across environments
editPost: {
  enabled: true,
  text: "Edit page",
  url: "https://github.com/your-user/your-repo/edit/main/",
},
js
OptionDescription
enabledWhether to show an edit link below the post title
textDisplay text for the edit link
urlBase URL for the edit link (file path will be appended)

Configuring Feature Toggles

The features object controls which feature modules are enabled or disabled:

features: {
  tags: true,        // Tag system
  categories: true,  // Category system
  series: true,      // Series posts
  archives: true,    // Archives page
  friends: true,     // Friends page
  projects: true,    // Projects showcase page
  search: true,      // Full-text search (Pagefind)
},
js

Dark Mode

darkMode: true,    // Light/dark theme toggle
js

Disabling dark mode will hide the theme toggle button in the UI.

AI Chat

AI chat is controlled by SITE.ai.enabled. Enable the @astro-minimax/ai package first, then configure:

ai: {
  enabled: true,
  mockMode: true,
  apiEndpoint: "/api/chat",
  model: "@cf/zai-org/glm-4.7-flash",
},
js

Waline Comments

Waline comments are controlled by SITE.waline.enabled:

waline: {
  enabled: true,
  serverURL: "https://your-waline-server.vercel.app/",
  // ...
},
js

Sponsorship

Sponsorship is controlled by SITE.sponsor.enabled:

sponsor: {
  enabled: true,
  methods: [
    { name: "WeChat Pay", icon: "wechat", image: "/images/wechat-pay.svg" },
    { name: "Alipay", icon: "alipay", image: "/images/alipay.svg" },
  ],
  sponsors: [],
},
js

Disabling a feature will automatically hide the corresponding menu item and page.

Configuring Navigation Menu

The nav object controls which menu items appear in the navigation bar:

nav: {
  items: [
    { key: "home", enabled: true },
    { key: "posts", enabled: true },
    { key: "tags", enabled: true },
    { key: "categories", enabled: true },
    { key: "series", enabled: true },
    { key: "projects", enabled: true },
    { key: "about", enabled: true },
    { key: "friends", enabled: true },
    { key: "archives", enabled: true },
  ],
},
js

Set enabled: false to hide specific menu items. Menu visibility is also affected by features toggles — if a feature is disabled, its menu item is automatically hidden too.

Configuring Projects

List your GitHub projects in SITE.projects:

projects: [
  { repo: "souloss/astro-minimax", featured: true },
  { repo: "withastro/astro" },
  { repo: "your-user/your-project", description: "Custom description" },
],
js
OptionDescription
repoGitHub repository name in owner/name format
featuredWhether to highlight as a featured project
descriptionCustom description (auto-fetches from GitHub if omitted)

Update layout width

The default max-width for the entire blog is 768px (max-w-3xl). If you’d like to change it, update the max-w-app utility in global.css:

@utility max-w-app {
  @apply max-w-3xl;
  @apply max-w-4xl xl:max-w-5xl;
}
css

You can explore more max-width values in the Tailwind CSS docs.

Configuring logo or title

Option 1: SITE title text

The easiest option. Just update SITE.title.

Option 2: Astro’s SVG component

For SVG logos:

---
import DummyLogo from "@/assets/dummy-logo.svg";
---

<a href="/" class="...">
  <DummyLogo class="scale-75 dark:invert" />
</a>
astro

Option 3: Astro’s Image component

For bitmap logos (non-SVG):

---
import { Image } from "astro:assets";
import dummyLogo from "@/assets/dummy-logo.png";
---

<a href="/" class="...">
  <Image src={dummyLogo} alt="My Blog" class="dark:invert" />
</a>
astro

Social links icons example

Configure social links in SOCIALS inside src/constants.ts:

Available built-in icons: IconGitHub, IconBrandX, IconLinkedin, IconFacebook, IconTelegram, IconMail, IconWhatsapp, IconPinterest, IconRss.

Configure post share buttons in SHARE_LINKS inside src/constants.ts:

Share links icons example

export const SHARE_LINKS = [
  {
    name: "X",
    href: "https://x.com/intent/post?url=",
    linkTitle: "Share on X",
    icon: IconBrandX,
  },
  // ...
];
ts

Configuring Waline Comments

astro-minimax comes with a built-in Waline comment system. Configure it in SITE.waline:

OptionDescription
enabledEnable or disable the comment system
serverURLWaline server URL (requires self-hosting)
emojiEmoji pack configuration
langComment widget language
pageviewShow page view counter
reactionEnable emoji reactions
loginLogin mode: enable / disable / force
wordLimitComment word limit [min, max]
imageUploaderAllow image uploads
requiredMetaRequired fields
copyrightShow Waline copyright
recaptchaV3KeyGoogle reCAPTCHA v3 key (optional)
turnstileKeyCloudflare Turnstile key (optional)

You need to deploy a Waline server first. See the Waline documentation.

astro-minimax supports two search providers. Pagefind is used by default with no extra configuration.

Pagefind (Default)

Built-in static search engine. Search index is auto-generated at build time. Works out of the box.

Algolia DocSearch

To use Algolia DocSearch cloud search, configure SITE.search:

search: {
  provider: 'docsearch',
  docsearch: {
    appId: 'YOUR_ALGOLIA_APP_ID',
    apiKey: 'YOUR_ALGOLIA_SEARCH_API_KEY',
    indexName: 'YOUR_INDEX_NAME',
    placeholder: 'Search docs...',
  },
},
js
OptionDescription
providerSearch provider: 'pagefind' (default) or 'docsearch'
docsearch.appIdAlgolia Application ID
docsearch.apiKeyAlgolia Search-Only API Key
docsearch.indexNameAlgolia index name
docsearch.placeholderSearch box placeholder text

DocSearch requires applying or self-hosting an Algolia index. When enabled, the DocSearch button replaces the default Pagefind search link in the header.

Configuring AI Chat

astro-minimax includes a built-in AI chat assistant powered by @astro-minimax/ai. Configure it in SITE.ai:

ai: {
  enabled: true,
  mockMode: true,
  apiEndpoint: "/api/chat",
  model: "@cf/zai-org/glm-4.7-flash",
  welcomeMessage: undefined,
  placeholder: undefined,
},
js
OptionDescription
enabledEnable AI chat (set to true)
mockModeReturns preset responses without calling a real API, useful for development
apiEndpointAPI endpoint URL. Use /api/chat for Cloudflare Pages Functions
modelModel ID. Defaults to Cloudflare Workers AI GLM-4.7 Flash
welcomeMessageCustom welcome message
placeholderCustom input placeholder text

The AI chat feature uses Cloudflare Pages Functions as the backend. Deployment on Cloudflare with AI Binding configuration is required. See the apps/blog/functions/ directory and wrangler.toml for details.

Configuring Sponsorship

Configure donation/tip features in SITE.sponsor:

sponsor: {
  enabled: true,
  methods: [
    { name: "WeChat Pay", icon: "wechat", image: "/images/wechat-pay.svg" },
    { name: "Alipay", icon: "alipay", image: "/images/alipay.svg" },
  ],
  sponsors: [
    { name: "John", amount: 50, date: "2026-01-15" },
  ],
},
js
OptionDescription
enabledEnable sponsorship
methodsPayment methods: name, icon (identifier), image (QR code image path)
sponsorsSponsors list: name, amount, date, platform (optional)

Place payment QR code images in the public/images/ directory.

Configure the copyright license in SITE.copyright:

copyright: {
  license: "CC BY-NC-SA 4.0",
  licenseUrl: "https://creativecommons.org/licenses/by-nc-sa/4.0/",
},
js

Configuring Umami Analytics

Configure Umami privacy-friendly analytics in SITE.umami:

umami: {
  enabled: false,
  websiteId: "your-website-id",
  src: "https://your-umami-instance.com/script.js",
},
js
OptionDescription
enabledEnable Umami analytics
websiteIdWebsite ID in your Umami instance
srcUmami tracking script URL

You need to deploy a Umami instance first. See the Umami documentation.

Configuring fonts

astro-minimax uses Astro’s experimental fonts API with Google Sans Code as the default font.

Customizing the font

To use a different font, update three places:

  1. Font configuration in astro.config.ts:
  1. Font component in Layout.astro:
---
import { Font } from "astro:assets";
---

<head>
  <Font
    cssVariable="--font-your-font"
    preload={[{ subset: "latin", weight: 400, style: "normal" }]}
  />
</head>
astro
  1. CSS variable in global.css:
@theme inline {
  --font-app: var(--font-your-font);
}
css

The --font-app variable is used throughout the theme via the font-app Tailwind utility class.

Conclusion

This is the full specification of how to customize this theme. For a complete feature overview, see the Feature Overview.



Previous Post
Getting Started: Three Integration Methods
Next Post
Adding new posts in astro-minimax theme

评论区

文明评论,共建和谐社区