Custom Domain
Bind a custom domain to your Moire blog
By default, your website address is username.github.io/moire. By binding a custom domain, you can use a personalized address like blog.yourname.com.
Prerequisites
Section titled “Prerequisites”- Own a domain name (can be purchased from Namecheap, Cloudflare, etc.)
- Ability to access your domain’s DNS settings
Two Deployment Methods
Section titled “Two Deployment Methods”Moire supports two deployment platforms, and the method for binding a domain differs slightly between them.
Binding a Domain on GitHub Pages
Section titled “Binding a Domain on GitHub Pages”-
Go to your Forked repository.
-
Click Settings → Pages.
-
Under Custom domain, enter your domain name:
blog.yourname.com -
Click Save.
-
Wait for the DNS check to complete (may take a few minutes).
-
Check Enforce HTTPS (highly recommended).
Configure DNS
Section titled “Configure DNS”Add DNS records at your domain provider’s side:
Using a Subdomain (Recommended):
| Type | Name | Value |
|---|---|---|
| CNAME | blog | username.github.io |
Using a Root Domain:
| Type | Name | Value |
|---|---|---|
| A | @ | 185.199.108.153 |
| A | @ | 185.199.109.153 |
| A | @ | 185.199.110.153 |
| A | @ | 185.199.111.153 |
Binding a Domain on Vercel
Section titled “Binding a Domain on Vercel”-
Log in to Vercel Dashboard.
-
Select your Moire project.
-
Click Settings → Domains.
-
Enter your domain name:
blog.yourname.com -
Click Add.
-
Vercel will prompt you with the DNS records you need to add.
Configure DNS
Section titled “Configure DNS”Following Vercel’s instructions, this usually involves adding a CNAME record:
| Type | Name | Value |
|---|---|---|
| CNAME | blog | cname.vercel-dns.com |
DNS Propagation Time
Section titled “DNS Propagation Time”DNS records usually take some time to take effect:
| Time Range | Description |
|---|---|
| 5-10 mins | Fast providers (e.g., Cloudflare) |
| 1-4 hours | Most providers |
| 24-48 hours | Worst-case scenario |
Update Configuration File
Section titled “Update Configuration File”After binding your domain, you need to update the baseUrl in moire.config.ts:
export default { title: "My Blog", baseUrl: "https://blog.yourname.com", // Add this line // ... other configs}Commit this change to GitHub and wait for the build to complete.
Troubleshooting
Section titled “Troubleshooting”DNS propagated but site still inaccessible?
Section titled “DNS propagated but site still inaccessible?”- Check GitHub Pages / Vercel status.
- Ensure DNS record types and values are exactly correct.
- Clear your browser cache.
SSL Certificate Error?
Section titled “SSL Certificate Error?”- GitHub Pages: Ensure “Enforce HTTPS” is checked and wait for the certificate (up to 24 hours).
- Vercel: Handled automatically; contact Vercel support if it fails.
Showing 404?
Section titled “Showing 404?”- Ensure you updated the
baseUrlconfiguration. - Check if GitHub Actions built successfully.
- Try accessing
/index.htmlto confirm the file exists.
Best Practices
Section titled “Best Practices”Using Cloudflare
Section titled “Using Cloudflare”Managing your domain through Cloudflare provides:
- ⚡ CDN acceleration
- 🛡️ DDoS protection
- 🔒 Free SSL
- 📊 Traffic analytics
Setup steps:
- Add your domain to Cloudflare.
- Update your domain registrar’s Nameservers to Cloudflare’s.
- Add DNS records in Cloudflare.
- Enable Proxied (orange cloud icon).
301 Redirects
Section titled “301 Redirects”If you want to redirect the old address to your new domain:
Add to vercel.json in Vercel:
{ "redirects": [ { "source": "/:path*", "destination": "https://blog.yourname.com/:path*", "permanent": true } ]}Next Steps
Section titled “Next Steps”Encountering issues? Check the troubleshooting guide.