How to Deploy This Astro Theme

By Goose
5 minutes read

Table of Contents

  1. 1. Prepare your environment
  2. 2. Update the most important configuration first
    1. astro.config.mjs
    2. src/config.ts
  3. 3. Organize your content correctly
  4. 4. Validate the production build locally
  5. 5. Easiest deployment targets: Vercel / Netlify / Cloudflare Pages
    1. Option A: Vercel
    2. Option B: Netlify
    3. Option C: Cloudflare Pages
  6. 6. What to watch for on GitHub Pages
  7. 7. Final checks before connecting a custom domain
  8. 8. Common problems
    1. The build succeeds, but styles are missing
    2. Search opens but returns no results
    3. Multilingual pages return 404
  9. 9. A simple recommended deployment workflow
  10. Summary

1. Prepare your environment

This theme is built with Astro, so you should have these tools ready:

After cloning the project, install dependencies:

Terminal window
git clone git@github.com:ErinaYip/goosequill.git
cd goosequill
npm install

Start local development with:

Terminal window
npm run dev

Create a production build with:

Terminal window
npm run build

This project does more than run astro build: it also runs Pagefind to generate search indexes. Because of that, npm run build is the best pre-deployment check.

2. Update the most important configuration first

Before deploying, review these files first.

astro.config.mjs

The two most important fields here are site and base:

For a root-domain deployment, a typical setup looks like this:

site: 'https://blog.example.com',
base: '/',

src/config.ts

This file controls the site title, description, RSS, search, table of contents, and pagination behavior.

At minimum, review these fields:

For single-language mode:

defaultLocale: 'en'

For multi-language mode:

defaultLocale: undefined

In this theme, routing works like this:

3. Organize your content correctly

Blog posts live under src/content/blog/, with one directory per post.

For example:

src/content/blog/my-post/
index_en.mdx
index_zh-cn.mdx

A practical recommendation:

If you only publish in English, the simplest setup is to keep English files and set:

defaultLocale: 'en'

4. Validate the production build locally

Before going live, run:

Terminal window
npm run build
npm run preview

npm run preview serves the production output locally, which is much closer to the real deployed environment than development mode.

Check these pages and features carefully:

5. Easiest deployment targets: Vercel / Netlify / Cloudflare Pages

Because this is a static site, it works well on most static hosting providers.

Option A: Vercel

When importing the repo into Vercel, you can usually use:

Option B: Netlify

Typical Netlify settings:

Option C: Cloudflare Pages

Typical Cloudflare Pages settings:

6. What to watch for on GitHub Pages

If you deploy to GitHub Pages, base is usually the most important setting.

If your site is published at:

https://<user>.github.io/goosequill/

then you will typically want:

base: '/goosequill'

You should also update site to match the final public URL.

If base is wrong, common symptoms include:

7. Final checks before connecting a custom domain

Before switching to your real domain, verify that:

If RSS and sitemap are enabled while site still points to a placeholder domain, the generated absolute URLs will be wrong.

8. Common problems

The build succeeds, but styles are missing

Check these first:

Search opens but returns no results

This theme uses Pagefind, so search depends on the generated index files. Confirm that:

Multilingual pages return 404

Check these first:

If you want a reliable workflow, use this one:

  1. Fork or clone the project
  2. Update site and base in astro.config.mjs
  3. Update the site title, description, and language mode in src/config.ts
  4. Add your own content
  5. Run npm run build
  6. Run npm run preview
  7. Push to your Git repository
  8. Connect the repository to Vercel, Netlify, or Cloudflare Pages
  9. After deployment, verify RSS, sitemap, and search

Summary

Deploying this theme is not complicated. In practice, it comes down to three things:

If those three parts are correct, deployment on most static hosting providers should be smooth.

A useful follow-up expansion for this post would be a dedicated section on: