diff --git a/content/en/posts/cloudflare-workers/gravatar-cloudflare-workers/index.md b/content/en/posts/cloudflare-workers/gravatar-cloudflare-workers/index.md
new file mode 100644
index 0000000..ced46df
--- /dev/null
+++ b/content/en/posts/cloudflare-workers/gravatar-cloudflare-workers/index.md
@@ -0,0 +1,245 @@
+---
+slug: "gravatar-cloudflare-workers"
+title: "使用 CloudFlare Workers 反向代理"
+subtitle: ""
+date: 2023-01-15T21:31:42+08:00
+draft: false
+author:
+ name: James
+ link: https://www.jamesflare.com
+ email:
+ avatar: /site-logo.avif
+description: "Gravatar 的头像服务在中国大陆不稳定。除了使用一些公开镜像,我们还能自行建立反代。不过如果要自己建立反代,就需要服务器,这可能需要额外的成本,更重要的一个问题是,一般人的服务器只能在一个机房,所以地区之间的速度差异会很大,而不像 Gravatar 在全球都有 CDN。"
+keywords: ["Gravatar","CloudFlare Workers"]
+license: ""
+comment: true
+weight: 0
+
+tags:
+- CloudFlare
+- JavaScript
+categories:
+- 教程
+
+hiddenFromHomePage: false
+hiddenFromSearch: false
+
+summary: "Gravatar 的头像服务在中国大陆不稳定。除了使用一些公开镜像,我们还能自行建立反代。不过如果要自己建立反代,就需要服务器,这可能需要额外的成本,更重要的一个问题是,一般人的服务器只能在一个机房,所以地区之间的速度差异会很大,而不像 Gravatar 在全球都有 CDN。"
+resources:
+- name: featured-image
+ src: featured-image.jpg
+- name: featured-image-preview
+ src: featured-image-preview.jpg
+
+toc:
+ enable: true
+math:
+ enable: false
+lightgallery: true
+seo:
+ images: []
+
+repost:
+ enable: true
+ url: ""
+
+# See details front matter: https://fixit.lruihao.cn/theme-documentation-content/#front-matter
+---
+
+## Introduction
+
+In mainland China, Gravatar's avatar service has always been unstable and unavailable. In addition to using some public mirror sites, we can also set up our own reverse proxy. However, if you want to set up your own reverse proxy, you need a server, which may incur additional costs. More importantly, a typical person's server can only be located in one data center, resulting in large speed differences between regions, unlike Gravatar which has a global CDN network.
+
+I hope that users worldwide can enjoy fast loading speeds. At the very least, the proxies used by users may also be distributed globally, right?
+
+{{< image src="network-map.svg" width="750px" caption="CloudFlare Network Map" >}}
+
+[CloudFlare Workers](https://developers.cloudflare.com/workers/learning/how-workers-works/) can directly process requests in their nearby data centers, which is much faster than using a random server.
+
+## Pricing
+
+So, what is the [pricing](https://developers.cloudflare.com/workers/platform/pricing) for Workers?
+
+| | Free Plan | Paid Plan - Bundled | Paid Plan - Unbound |
+| -------- | -------------------------- | ---------------------------------- | ------------------------------------------------- |
+| Requests | 100,000 / day | 10 million / month, +$0.50/million | 1 million / month, + $0.15/million |
+| Duration | 10ms CPU time / invocation | 50 ms CPU time / invocation | 400,000 GB-s, + $12.50/million GB-s |
+
+The free plan is generally sufficient for most use cases.
+
+You get 100,000 free requests per day, which is basically inexhaustible. The 10ms CPU time per invocation is also adequate, as our code likely only takes around 1ms to execute.
+
+Even if you do need to pay, since we don't require Workers KV, Queues, Durable Objects, or other products, and only need the number of requests, the Paid Plan - Unbound tier applies. 1 million requests cost a mere $0.15, equivalent to about one Chinese yuan, which is incredibly cheap.
+
+### Cost Calculation
+
+Assuming each image is around 30KB, 1 million images would consume approximately 28.6GB of traffic. Considering that VPS providers may calculate traffic in both directions, it would be about 57.2GB.
+
+The price of 57GB per yuan is considered average in the VPS market, not particularly cheap, especially when compared to unlimited traffic plans or Russian VPS offerings. However, when taking into account the quality of the network and the global distribution of data centers, CloudFlare's offering is unbeatable.
+
+CloudFlare's speed is not something that cheap VPS plans can match. If you were to use a premium network like CN2, the price would definitely be much higher.
+
+## Workers JavaScript
+
+The usage is very straightforward, essentially just JavaScript.
+
+Let's construct a simple example:
+
+```JavaScript
+addEventListener(
+ "fetch", event => {
+ let url = new URL(event.request.url);
+ url.hostname = "www.gravatar.com";
+ url.protocol = "https";
+ let request = new Request(url, event.request);
+ event.respondWith(
+ fetch(request)
+ )
+ }
+)
+```
+
+In essence, the logic is to return the requested URL received via HTTPS, but change the `hostname` sent at the time of the request to `www.gravatar.com`.
+
+### Deployment
+
+The deployment process is also very simple. Create a new Service in the CloudFlare Workers dashboard.
+
+Copy the above code into it and click Deploy.
+
+## Custom Domains
+
+By default, you will be assigned a workers.dev subdomain, which is perfectly fine to use. However, I prefer to set up my own custom domain.
+
+Go to the Service settings, then to Triggers, click Add Custom Domains, and enter your desired domain name.
+
+For example, if I choose gravatar.jamesflare.com, I would enter `gravatar.jamesflare.com`.
+
+## Testing
+
+Let's test it out and see if it works. Here, I'll use my avatar URL for testing: `/avatar/75cea16f157b9c5da5435379ab6cf294?s=32&d=`.
+
+Constructing the URL:
+
+ https://gravatar.jamesflare.com/avatar/75cea16f157b9c5da5435379ab6cf294?s=32&d=
+
+As you can see, it works perfectly.
+
+## Usage in Hugo
+
+This part is somewhat derivative. The process can be quite convoluted and may vary between different themes, so I want to focus on the thought process rather than providing a direct solution, as it may not be universally applicable.
+
+I am using the FixIt theme, which is roughly equivalent to LoveIt.
+
+### Locating the Template File
+
+After some searching, I found that the template responsible for rendering the author's avatar in articles is located at `/FixIt/layouts/partials/single/post-author.html`.
+
+The code is as follows:
+
+```go-html-template
+{{- $params := .Scratch.Get "params" -}}
+
+{{- $author := .Site.Author | merge (dict "name" "Anonymous" "link" (echoParam $params "authorlink") "email" (echoParam $params "authoremail")) -}}
+{{- $avatar := .Site.Params.home.profile.avatarURL -}}
+{{- if isset $params "author" | and (ne $params.author .Site.Author.name) -}}
+ {{- $author = dict "name" $params.author | merge $author -}}
+ {{- $author = dict "link" (echoParam $params "authorlink") | merge $author -}}
+ {{- $author = dict "email" (echoParam $params "authoremail") | merge $author -}}
+ {{- $avatar = "" -}}
+{{- end -}}
+{{- if (not $avatar | or $params.gravatarForce) | and $author.email -}}
+ {{- $gravatar := .Site.Params.gravatar -}}
+ {{- with $gravatar -}}
+ {{- $avatar = printf "https://%v/avatar/%v?s=32&d=%v"
+ (path.Clean .Host | default "www.gravatar.com")
+ (md5 $author.email)
+ (.Style | default "")
+ -}}
+ {{- end -}}
+{{- end -}}
+
+ {{- $content := $author.name -}}
+ {{- $icon := dict "Class" "fa-solid fa-user-circle" -}}
+ {{- if $avatar -}}
+ {{- $content = printf "%v %v" (dict "Src" $avatar "Class" "avatar" "Alt" $author.name | partial "plugin/image.html") $author.name -}}
+ {{- $icon = "" -}}
+ {{- end -}}
+ {{- if $author.link -}}
+ {{- $options := dict "Class" "author" "Destination" $author.link "Title" (T "single.author") "Rel" "author" "Icon" $icon "Content" $content -}}
+ {{- partial "plugin/link.html" $options -}}
+ {{- else -}}
+
+ {{- with $icon -}}
+ {{ . | partial "plugin/icon.html" }}
+ {{ end -}}
+ {{- $content | safeHTML -}}
+
+ {{- end -}}
+
+{{- /* EOF */ -}}
+```
+
+### Identifying the Relevant Code Section
+
+The following code snippet is responsible for handling the avatar:
+
+```go-html-template
+{{- if (not $avatar | or $params.gravatarForce) | and $author.email -}}
+ {{- $gravatar := .Site.Params.gravatar -}}
+ {{- with $gravatar -}}
+ {{- $avatar = printf "https://%v/avatar/%v?s=32&d=%v"
+ (path.Clean .Host | default "www.gravatar.com")
+ (md5 $author.email)
+ (.Style | default "")
+ -}}
+ {{- end -}}
+{{- end -}}
+```
+
+It checks the value of the `Host` item under the `gravatar` sub-item of the `params` section in the configuration file.
+
+If the `Host` item is empty, it defaults to `www.gravatar.com`.
+
+There are two possible approaches: modifying the HTML template itself or modifying the value in the configuration file.
+
+### Configuring the .toml File
+
+I opted for the second approach.
+
+My configuration file is in the .toml format, so I'll construct it as follows:
+
+```toml
+[params]
+ [params.gravatar]
+ host = "gravatar.jamesflare.com"
+```
+
+### Previewing in the Browser
+
+Regenerate the site. Here, I only need to preview it:
+
+```bash
+hugo server -D -e production --disableFastRender
+```
+
+Open the browser and navigate to `http://localhost:1313/`. Check the relevant part of the HTML source code:
+
+```html
+data-src="https://gravatar.jamesflare.com/avatar/75cea16f157b9c5da5435379ab6cf294?s=32&d="
+data-srcset="https://gravatar.jamesflare.com/avatar/75cea16f157b9c5da5435379ab6cf294?s=32&d=, https://gravatar.jamesflare.com/avatar/75cea16f157b9c5da5435379ab6cf294?s=32&d= 1.5x, https://gravatar.jamesflare.com/avatar/75cea16f157b9c5da5435379ab6cf294?s=32&d= 2x"
+```
+
+As you can see, the change has taken effect, which can also be verified using the Sources tab in the browser's developer tools.
+
+### Side Note
+
+As a side note, it turns out that the FixIt theme's configuration file already included this option, and I was the clown for not noticing it earlier, despite searching extensively online. Here's the relevant section:
+
+```toml
+[params]
+ [params.gravatar]
+ # Gravatar host, default: "www.gravatar.com"
+ host = "www.gravatar.com" # ["cn.gravatar.com", "gravatar.loli.net", ...]
+ style = "" # ["", "mp", "identicon", "monsterid", "wavatar", "retro", "blank", "robohash"]
+```
\ No newline at end of file
diff --git a/content/en/posts/cloudflare-workers/gravatar-cloudflare-workers/network-map.svg b/content/en/posts/cloudflare-workers/gravatar-cloudflare-workers/network-map.svg
new file mode 100644
index 0000000..b8ff1ec
--- /dev/null
+++ b/content/en/posts/cloudflare-workers/gravatar-cloudflare-workers/network-map.svg
@@ -0,0 +1,500 @@
+
+
+
diff --git a/content/zh-cn/posts/cloudflare-workers/gravatar-cloudflare-workers/index.md b/content/zh-cn/posts/cloudflare-workers/gravatar-cloudflare-workers/index.md
new file mode 100644
index 0000000..55859be
--- /dev/null
+++ b/content/zh-cn/posts/cloudflare-workers/gravatar-cloudflare-workers/index.md
@@ -0,0 +1,247 @@
+---
+slug: "gravatar-cloudflare-workers"
+title: "使用 CloudFlare Workers 反向代理"
+subtitle: ""
+date: 2023-01-15T21:31:42+08:00
+draft: false
+author:
+ name: James
+ link: https://www.jamesflare.com
+ email:
+ avatar: /site-logo.avif
+description: "Gravatar 的头像服务在中国大陆不稳定。除了使用一些公开镜像,我们还能自行建立反代。不过如果要自己建立反代,就需要服务器,这可能需要额外的成本,更重要的一个问题是,一般人的服务器只能在一个机房,所以地区之间的速度差异会很大,而不像 Gravatar 在全球都有 CDN。"
+keywords: ["Gravatar","CloudFlare Workers"]
+license: ""
+comment: true
+weight: 0
+
+tags:
+- CloudFlare
+- JavaScript
+categories:
+- 教程
+
+hiddenFromHomePage: false
+hiddenFromSearch: false
+
+summary: "Gravatar 的头像服务在中国大陆不稳定。除了使用一些公开镜像,我们还能自行建立反代。不过如果要自己建立反代,就需要服务器,这可能需要额外的成本,更重要的一个问题是,一般人的服务器只能在一个机房,所以地区之间的速度差异会很大,而不像 Gravatar 在全球都有 CDN。"
+resources:
+- name: featured-image
+ src: featured-image.jpg
+- name: featured-image-preview
+ src: featured-image-preview.jpg
+
+toc:
+ enable: true
+math:
+ enable: false
+lightgallery: true
+seo:
+ images: []
+
+repost:
+ enable: true
+ url: ""
+
+# See details front matter: https://fixit.lruihao.cn/theme-documentation-content/#front-matter
+---
+
+## Introduction
+
+在中国大陆 Gravatar 的头像服务一直处于不稳定,不可用的状态。除了使用一些公开服务,我们还能自行建立反代。
+
+不过如果要自己建立反代,就需要服务器,这可能需要额外的成本,更重要的一个问题是,一般人的服务器只能在一个机房,所以地区之间的速度差异会很大,而不像 Gravatar 在全球都有 CDN。
+
+我希望全球的用户加载速度都很快,退一万步说,用户挂的代理也可能遍布全球,是吧。
+
+{{< image src="network-map.svg" width="750px" caption="CloudFlare Network Map" >}}
+
+而 [CloudFlare Workers](https://developers.cloudflare.com/workers/learning/how-workers-works/) 直接可以在他们就近的数据中心处理,不比随便整一个服务器快多了。
+
+## Pricing
+
+那么,Workers 的[价格](https://developers.cloudflare.com/workers/platform/pricing)如何?
+
+| | Free plan | Paid Plan - Bundled | Paid plan - Unbound |
+| -------- | -------------------------- | ---------------------------------- | ------------------------------------------------- |
+| Requests | 100,000 / day | 10 million / month, +$0.50/million | 1 million / month, + $0.15/million |
+| Duration | 10ms CPU time / invocation | 50 ms CPU time / invocation | 400,000 GB-s, + $12.50/million GB-s |
+
+**答**,一般免费计划完全够用。
+
+每天有 10 万次免费请求,基本上是用不完的。10ms 的 CPU 时间,这也是足够的,我们的代码估计也就 1ms 的时间。
+
+退一万步,就算是要付钱,由于不需要 Workers KV,Queues,Durable Objects 等产品,只要单纯的请求数,也就是 Paid plan - Unbound。100 万次也就 $0.15,一元人民币的样子,巨便宜好吧。
+
+### Calculation
+
+图片算 30KB 一张的话,100 万张也就是 28.6G 流量,算上 VPS 可能是双向计算流量的,那就是 57.2G 的样子。
+
+57G/元的价格放到 VPS 领域,可以说是中等水平,不算便宜,毕竟还有无限流量,俄罗斯 VPS 什么的不是?但是考虑到线路的水平,和全球的数据中心,这直接杀爆了。
+
+CloudFlare 的速度也不是什么俄罗斯小鸡可以比的,如果是 CN2 这样的高级线路,那这个价格肯定是买不到的。
+
+## Workers JS
+
+使用方法很简单,基本上就是 JavaScript。
+
+我们小小构造一下,
+
+```JavaScript
+addEventListener(
+ "fetch", event => {
+ let url = new URL(event.request.url);
+ url.hostname = "www.gravatar.com";
+ url.protocol = "https";
+ let request = new Request(url, event.request);
+ event.respondWith(
+ fetch(request)
+ )
+ }
+)
+```
+
+逻辑说白了就是返回以 https 请求收到的请求 URL,不过把请求时候发的`hostname`改成`www.gravatar.com`。
+
+### Deploy
+
+使用方法也很简单,在 CloudFlare 的 Workers 面板新建一个 Service。
+
+把上面这个抄到里面,并且 Deploy。
+
+## Custom Domains
+
+默认会给你一个 workers.dev 的三级域名,如果你想用也完全没有问题,但是我希望设置一个自己的域名。
+
+我们进入 Service,到 Trigger,点 Add Custom Domains,输入你需要的域名。
+
+比如我选择 gravatar.jamesflare.com,那就输入`gravatar.jamesflare.com`。
+
+## Testing
+
+那我们测试一下,看看能不能用,这里用我头像测试`/avatar/75cea16f157b9c5da5435379ab6cf294?s=32&d=`。
+
+构造一下,
+
+ https://gravatar.jamesflare.com/avatar/75cea16f157b9c5da5435379ab6cf294?s=32&d=
+
+可以看到,是没问题的。
+
+## Use in Hugo
+
+这属于衍生部分,其实过程相对曲折,而且不同主题可能还不一样,所以我希望记录一下思路而不是直接说结果,毕竟方案可能不通用。
+
+我用的主题是 FixIt,约等于 LoveIt。
+
+### Find Template File
+
+通过查找,发现负责文章作者头像的模板位于`/FixIt/layouts/partials/single/post-author.html`
+
+代码如下,
+
+```go-html-template
+{{- $params := .Scratch.Get "params" -}}
+
+{{- $author := .Site.Author | merge (dict "name" "Anonymous" "link" (echoParam $params "authorlink") "email" (echoParam $params "authoremail")) -}}
+{{- $avatar := .Site.Params.home.profile.avatarURL -}}
+{{- if isset $params "author" | and (ne $params.author .Site.Author.name) -}}
+ {{- $author = dict "name" $params.author | merge $author -}}
+ {{- $author = dict "link" (echoParam $params "authorlink") | merge $author -}}
+ {{- $author = dict "email" (echoParam $params "authoremail") | merge $author -}}
+ {{- $avatar = "" -}}
+{{- end -}}
+{{- if (not $avatar | or $params.gravatarForce) | and $author.email -}}
+ {{- $gravatar := .Site.Params.gravatar -}}
+ {{- with $gravatar -}}
+ {{- $avatar = printf "https://%v/avatar/%v?s=32&d=%v"
+ (path.Clean .Host | default "www.gravatar.com")
+ (md5 $author.email)
+ (.Style | default "")
+ -}}
+ {{- end -}}
+{{- end -}}
+
+ {{- $content := $author.name -}}
+ {{- $icon := dict "Class" "fa-solid fa-user-circle" -}}
+ {{- if $avatar -}}
+ {{- $content = printf "%v %v" (dict "Src" $avatar "Class" "avatar" "Alt" $author.name | partial "plugin/image.html") $author.name -}}
+ {{- $icon = "" -}}
+ {{- end -}}
+ {{- if $author.link -}}
+ {{- $options := dict "Class" "author" "Destination" $author.link "Title" (T "single.author") "Rel" "author" "Icon" $icon "Content" $content -}}
+ {{- partial "plugin/link.html" $options -}}
+ {{- else -}}
+
+ {{- with $icon -}}
+ {{ . | partial "plugin/icon.html" }}
+ {{ end -}}
+ {{- $content | safeHTML -}}
+
+ {{- end -}}
+
+{{- /* EOF */ -}}
+```
+
+### Find Code Section
+
+如下片段是负责头像的
+
+```go-html-template
+{{- if (not $avatar | or $params.gravatarForce) | and $author.email -}}
+ {{- $gravatar := .Site.Params.gravatar -}}
+ {{- with $gravatar -}}
+ {{- $avatar = printf "https://%v/avatar/%v?s=32&d=%v"
+ (path.Clean .Host | default "www.gravatar.com")
+ (md5 $author.email)
+ (.Style | default "")
+ -}}
+ {{- end -}}
+{{- end -}}
+```
+
+可以看见它判定配置文件 params 项下 gravatar 子项,Host 项下的值。
+
+如果 Host 项是空,则默认`www.gravatar.com`。
+
+那么很简单,有两种思路,一个是修改这个 HTML 模板本身,还有一个思路是修改配置文件的值。
+
+### Make .toml Config
+
+我选第二种。
+
+我的配置文件是 .toml 格式的,稍微构造一下。
+
+```toml
+[params]
+ [params.gravatar]
+ host = "gravatar.jamesflare.com"
+```
+
+### Preview in Browser
+
+重新生成一下站点,这里我只要预览即可,
+
+```bash
+hugo server -D -e production --disableFastRender
+```
+
+打开浏览器访问`http://localhost:1313/`,查看一下 HTML 源码有关部分。
+
+```html
+data-src="https://gravatar.jamesflare.com/avatar/75cea16f157b9c5da5435379ab6cf294?s=32&d="
+data-srcset="https://gravatar.jamesflare.com/avatar/75cea16f157b9c5da5435379ab6cf294?s=32&d=, https://gravatar.jamesflare.com/avatar/75cea16f157b9c5da5435379ab6cf294?s=32&d= 1.5x, https://gravatar.jamesflare.com/avatar/75cea16f157b9c5da5435379ab6cf294?s=32&d= 2x"
+```
+
+可以看到已经改过来了,通过浏览器开发工具 Sources 栏也可以验证。
+
+### Others
+
+小插曲,FixIt 的配置文件原来已经有这项了,小丑原来是我自己,不过全网都搜不到,哭了。
+
+```toml
+[params]
+ [params.gravatar]
+ # Gravatar host, default: "www.gravatar.com"
+ host = "www.gravatar.com" # ["cn.gravatar.com", "gravatar.loli.net", ...]
+ style = "" # ["", "mp", "identicon", "monsterid", "wavatar", "retro", "blank", "robohash"]
+```
\ No newline at end of file
diff --git a/content/zh-cn/posts/cloudflare-workers/gravatar-cloudflare-workers/network-map.svg b/content/zh-cn/posts/cloudflare-workers/gravatar-cloudflare-workers/network-map.svg
new file mode 100644
index 0000000..b8ff1ec
--- /dev/null
+++ b/content/zh-cn/posts/cloudflare-workers/gravatar-cloudflare-workers/network-map.svg
@@ -0,0 +1,500 @@
+
+
+