I recommend this theme https://github.com/adityatelange/hugo-PaperMod/

Azure Front Door(CDN)

购买一个 Front Door 服务,得到 xuesong-cxa7edcca8a7cgc4.z01.azurefd.net

  1. GitHub Pages 里删掉自定义域名

  2. Go to Azure Front Door add custom domain xuesong.cc

找到 Validate custom domain ownership,把 record 加入到 cloudflare,删除所有旧的 A, AAAA, CNAME 记录

  1. Cloudflare DNS 改成走 Front Door

加两条 CNAME

@: xuesong-cxa7edcca8a7cgc4.z01.azurefd.net

www: xuesong-cxa7edcca8a7cgc4.z01.azurefd.net

  1. Azure Front Door -> Front Door manager -> Update route -> Domains 改成 xuesong.cc

流量路径变成

User -> Cloudflare DNS 解析 (xuesong.cc) -> Azure Front Door 边缘节点(CDN)-> GitHub Pages (yxs.github.io)

➜  ~ dig xuesong.cc +short
dig xuesong.cc CNAME +short

13.107.253.70
13.107.226.70
# DNS 验证成功

➜  ~ curl -I https://xuesong.cc
HTTP/2 200
date: Tue, 11 Nov 2025 21:20:43 GMT
content-type: text/html; charset=utf-8
content-length: 12984
last-modified: Mon, 10 Nov 2025 21:58:57 GMT
access-control-allow-origin: *
etag: "69126021-32b8"
expires: Tue, 11 Nov 2025 21:30:43 GMT
cache-control: max-age=600
x-proxy-cache: MISS
x-github-request-id: 9185:24E60C:29F2A0:2B15D7:6913A8AB
age: 0
via: 1.1 varnish
x-served-by: cache-bfi-krnt7300048-BFI
x-cache: TCP_MISS
x-cache-hits: 0
x-timer: S1762896044.779009,VS0,VE98
vary: Accept-Encoding
x-fastly-request-id: aa75609d447e2febd359cb45c59c90802c97db93
x-azure-ref: 20251111T212043Z-18444cf5797z7ddlhC1SJC52zc0000000tdg000000005n3a
x-fd-int-roxy-purgeid: 0
accept-ranges: bytes
# CDN 路由,Front Door 代理成功

➜  ~ openssl s_client -connect xuesong.cc:443 -servername xuesong.cc </dev/null 2>/dev/null | openssl x509 -noout -issuer -subject -dates

issuer=C=US, O=DigiCert, Inc., CN=GeoTrust Global TLS RSA4096 SHA256 2022 CA1
subject=CN=xuesong.cc
notBefore=Nov 11 00:00:00 2025 GMT
notAfter=Apr 14 23:59:59 2026 GMT
# 证书已签发,域名正确

如果离职了,不想要自费 CDN 加速

  1. Cloudflare DNS 改回 GitHub Pages

https://docs.github.com/en/pages/configuring-a-custom-domain-for-your-github-pages-site/managing-a-custom-domain-for-your-github-pages-site

参考上面的文章,移除 Azure 的 records,加回 GitHub Pages 的 A, AAAA, CNAME

  1. GitHub Repo -> Settings -> Pages,Custom domain 添加 xuesong.cc

流量路径变回

User -> Cloudflare DNS 解析 (xuesong.cc) -> GitHub Pages (yxs.github.io)

如果 dig xuesong.cc +short 返回的是 githubpage 的 IP,curl -I https://xuesong.cc 的返回信息中关键字也是 GitHub 就代表成功

Azure Application Insights

<!-- Azure Application Insights -->
<script type="text/javascript">
    (function (c, o, n, f, i, g) {
        c[f] = c[f] || function () { (c[f].q = c[f].q || []).push(arguments) };
        i = o.createElement(n); i.async = 1; i.src = "https://az416426.vo.msecnd.net/scripts/b/ai.2.min.js";
        g = o.getElementsByTagName(n)[0]; g.parentNode.insertBefore(i, g);
    })(window, document, "script", "appInsights");
    appInsights("init", {
        instrumentationKey: "YOUR_INSTRUMENTATION_KEY"
    });
    appInsights("trackPageView");
</script>