Register Domain Name
All you need is one domain name, and everything else can live as a subdomain off it.
For long-term, I’d suggest Cloudflare. At least for now there is no price gouging and yearly costs stay the same.
Cloudflare sell domains at the Registry cost price.
You are forced to use Cloudflare DNS. I didn’t even notice this because I would use their DNS anyway since their free tier is awesome imo.
If you buy domain from CF then use CF’s NS it is free, but if you want to use NS server outside CF then it better to transfer the domain out of CF or you need to pay much money to do it inside CF. But I think most people should fine with CF’s NS any way.
yezheng.dev on cloudflare
Using https://tld-list.com to find the cheapest registrar for a given TLD. $2 is the most I’ve ever paid for a 1-year “temp” domain for a project. Most are under $1.
The smart thing to do is to buy where the first year costs the lowest (for example at porkbun or namecheap) and the to transfer to Cloudflare to keep the next years price as low as possible.
I don’t care about my domain name so I got one for free for a year from freenom and shifted it to cloudflare for free lmao, next year I’ll just get another one since only me and a couple of friends use it.
numbered domains of xyz
The numbered domains permanently are 1 dollar. They are around $1.00 per year and the renewal is also $1.00 per year. I used porkbun to register mine but a lot of domain registrar sites have it available. I registered it for 10 years for some $12 total
Use a Custom Domain
If you’d like to use a custom domain for your GitHub Pages site, create a file static/CNAME. Your custom domain name should be the only contents inside CNAME. Since it’s inside static, the published site will contain the CNAME file at the root of the published site, which is a requirements of GitHub Pages.
DNS service provider
Create Cloudflare account
Enter your domain name
|
|
Review your DNS records
Add more DNS records for zhengye.me
| Type | Name | Content | TTL | Proxy status |
|---|---|---|---|---|
| A | zhengye.me | 192.30.252.154 | Auto | Proxied |
| A | zhengye.me | 192.30.252.153 | Auto | Proxied |
| CNAME | www | csyezheng.github.io | Auto | Proxied |
Change your nameservers
- Log in to your registrar account
Determine your registrar via WHOIS.
Remove these nameservers:
|
|
- Replace with Cloudflare’s nameservers
Nameserver 1
|
|
Nameserver 2
|
|
Deploy with Cloudflare Pages
-
Log in to the Cloudflare dashboard
-
In Account Home, select Workers & Pages > Create application > Pages > Connect to Git.
-
Select the new GitHub repository that you created and, in the Set up builds and deployments section, provide the following information:
Configuration option Value Production branch mainBuild command hugoBuild directory public -
After completing deployment configuration, select the Save and Deploy. You should see Cloudflare Pages installing
hugoand your project dependencies, and building your site, before deploying it. -
After deploying your site, you will receive a unique subdomain for your project on
*.pages.dev. Every time you commit new code to your Hugo site, Cloudflare Pages will automatically rebuild your project and deploy it. You will also get access to preview deployments on new pull requests, so you can preview how changes look to your site before deploying them to production.