Skip to content

Commit a400dc9

Browse files
committed
Specify the version of the images in the CDN
1 parent 6a4169f commit a400dc9

File tree

7 files changed

+25
-20
lines changed

7 files changed

+25
-20
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
**[Live Demo →](https://chirpy.cotes.info)**
2121

22-
[![Devices Mockup](https://cdn.jsdelivr.net/gh/cotes2020/chirpy-images/commons/devices-mockup.png)](https://chirpy.cotes.info)
22+
[![Devices Mockup](https://cdn.jsdelivr.net/gh/cotes2020/chirpy-images@0a003683c0c3ca549d12c309f9b3e03ea20981e5/commons/devices-mockup.png)](https://chirpy.cotes.info)
2323

2424
</div>
2525

@@ -159,7 +159,7 @@ Now publish your Jekyll site by:
159159

160160
2. Browse to your repository on GitHub. Select the tab _Settings_, then click _Pages_ in the left navigation bar, and then in the section **Source** of _GitHub Pages_, select the `/(root)` directory of branch `gh-pages` as the [publishing source][pages-src]. Remember to click <kbd>Save</kbd> before leaving.
161161

162-
![gh-pages-sources](https://cdn.jsdelivr.net/gh/cotes2020/chirpy-images/posts/20190809/gh-pages-sources.png)
162+
![gh-pages-sources](https://cdn.jsdelivr.net/gh/cotes2020/chirpy-images@0a003683c0c3ca549d12c309f9b3e03ea20981e5/posts/20190809/gh-pages-sources.png)
163163

164164
3. Visit your website at the address indicated by GitHub.
165165

_config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,10 @@ theme_mode: # [light|dark]
7979
# will be added to all image (site avatar & posts' images) paths starting with '/'
8080
#
8181
# e.g. 'https://cdn.com'
82-
img_cdn: ''
82+
img_cdn: 'https://cdn.jsdelivr.net/gh/cotes2020/chirpy-images@0a003683c0c3ca549d12c309f9b3e03ea20981e5'
8383

8484
# the avatar on sidebar, support local or CORS resources
85-
avatar: https://cdn.jsdelivr.net/gh/cotes2020/chirpy-images/commons/avatar.jpg
85+
avatar: '/commons/avatar.jpg'
8686

8787
# boolean type, the global switch for ToC in posts.
8888
toc: true

_posts/2019-08-08-text-and-typography.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ tags: [typography]
77
math: true
88
mermaid: true
99
image:
10-
src: https://cdn.jsdelivr.net/gh/cotes2020/chirpy-images/commons/devices-mockup.png
10+
src: /commons/devices-mockup.png
1111
width: 850
1212
height: 585
1313
---
@@ -99,34 +99,34 @@ Click the hook will locate the footnote[^footnote], and here is another footnote
9999

100100
- Default (with caption)
101101

102-
![Desktop View](https://cdn.jsdelivr.net/gh/cotes2020/chirpy-images/posts/20190808/mockup.png){: width="972" height="589" }
102+
![Desktop View](/posts/20190808/mockup.png){: width="972" height="589" }
103103
_Full screen width and center alignment_
104104

105105
<br>
106106

107107
- Shadow
108108

109-
![Window shadow](https://cdn.jsdelivr.net/gh/cotes2020/chirpy-images/posts/20190808/window.png){: .shadow width="1548" height="864" style="max-width: 90%" }
109+
![Window shadow](/posts/20190808/window.png){: .shadow width="1548" height="864" style="max-width: 90%" }
110110
_shadow effect (visible in light mode)_
111111

112112
<br>
113113

114114
- Left aligned
115115

116-
![Desktop View](https://cdn.jsdelivr.net/gh/cotes2020/chirpy-images/posts/20190808/mockup.png){: width="972" height="589" style="max-width: 70%" .normal}
116+
![Desktop View](/posts/20190808/mockup.png){: width="972" height="589" style="max-width: 70%" .normal}
117117

118118
<br>
119119

120120
- Float to left
121121

122-
![Desktop View](https://cdn.jsdelivr.net/gh/cotes2020/chirpy-images/posts/20190808/mockup.png){: width="972" height="589" style="max-width: 200px" .left}
122+
![Desktop View](/posts/20190808/mockup.png){: width="972" height="589" style="max-width: 200px" .left}
123123
"A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space."
124124

125125
<br>
126126

127127
- Float to right
128128

129-
![Desktop View](https://cdn.jsdelivr.net/gh/cotes2020/chirpy-images/posts/20190808/mockup.png){: width="972" height="589" style="max-width: 200px" .right}
129+
![Desktop View](/posts/20190808/mockup.png){: width="972" height="589" style="max-width: 200px" .right}
130130
"A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space. A repetitive and meaningless text is used to fill the space."
131131

132132
<br>

_posts/2019-08-09-getting-started.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ Now publish your Jekyll site by:
124124

125125
2. Browse to your repository on GitHub. Select the tab _Settings_, then click _Pages_ in the left navigation bar, and then in the section **Source** of _GitHub Pages_, select the `/(root)` directory of branch `gh-pages` as the [publishing source][pages-src]. Remember to click <kbd>Save</kbd> before leaving.
126126

127-
![gh-pages-sources](https://cdn.jsdelivr.net/gh/cotes2020/chirpy-images/posts/20190809/gh-pages-sources.png){: width="850" height="153" }
127+
![gh-pages-sources](/posts/20190809/gh-pages-sources.png){: width="850" height="153" }
128128

129129
3. Visit your website at the address indicated by GitHub.
130130

_posts/2021-01-03-enable-google-pv.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ With your property created, you now need to set up Data Stream to track your blo
3333

3434
It should look like this:
3535

36-
![google-analytics-data-stream](https://cdn.jsdelivr.net/gh/cotes2020/chirpy-images/posts/20210103/01-google-analytics-data-stream.png){: width="1086" height="542"}
36+
![google-analytics-data-stream](/posts/20210103/01-google-analytics-data-stream.png){: width="1086" height="542"}
3737

3838
Now, click on the new data stream and grab the **Measurement ID**. It should look something like `G-V6XXXXXXXX`. Copy this to your `_config.yml` file
3939

@@ -49,7 +49,7 @@ google_analytics:
4949
5050
When you push these changes to your blog, you should start seeing the traffic on your Google Analytics. Play around with Google Analytics dashboard to get familiar with the options available as it takes like 5 mins to pickup your changes. You should now be able to monitor your traffic in realtime.
5151
52-
![google-analytics-realtime](https://cdn.jsdelivr.net/gh/cotes2020/chirpy-images/posts/20210103/02-google-analytics-realtime.png){: width="616" height="557"}
52+
![google-analytics-realtime](/posts/20210103/02-google-analytics-realtime.png){: width="616" height="557"}
5353
5454
## Setup Page Views
5555
@@ -185,7 +185,7 @@ There is a detailed [tutorial](https://developers.google.com/analytics/solutions
185185

186186
If everything went good, you'll get this screen:
187187

188-
![superProxy-deployed](https://cdn.jsdelivr.net/gh/cotes2020/chirpy-images/posts/20210103/03-superProxy-deployed.png){: width="1366" height="354"}
188+
![superProxy-deployed](/posts/20210103/03-superProxy-deployed.png){: width="1366" height="354"}
189189

190190
### Create Google Analytics Query
191191

@@ -210,14 +210,14 @@ After <kbd>Run Query</kbd>, copy the generated contents of **API Query URI** at
210210

211211
After the query is saved on GAE, a **Public Endpoint** (public access address) will be generated, and we will get the query result in JSON format when accessing it. Finally, click <kbd>Enable Endpoint</kbd> in **Public Request Endpoint** to make the query effective, and click <kbd>Start Scheduling</kbd> in **Scheduling** to start the scheduled task.
212212

213-
![superproxy-query](https://cdn.jsdelivr.net/gh/cotes2020/chirpy-images/posts/20210103/04-superproxy-query.png){: width="1100" height="126"}
213+
![superproxy-query](/posts/20210103/04-superproxy-query.png){: width="1100" height="126"}
214214

215215

216216
## Configure Chirpy to Display Page View
217217

218218
Once all the hard part is done, it is very easy to enable the Page View on Chirpy theme. Your superProxy dashboard should look something like below and you can grab the required values.
219219

220-
![superproxy-dashboard](https://cdn.jsdelivr.net/gh/cotes2020/chirpy-images/posts/20210103/05-superproxy-dashboard.png){: width="1210" height="694"}
220+
![superproxy-dashboard](/posts/20210103/05-superproxy-dashboard.png){: width="1210" height="694"}
221221

222222
Update the `_config.yml` file of [**Chirpy**][chirpy-homepage] project with the values from your dashboard, to look similar to the following:
223223

docs/README.zh-CN.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
**[线上体验 →](https://chirpy.cotes.info)**
2121

22-
[![Devices Mockup](https://cdn.jsdelivr.net/gh/cotes2020/chirpy-images/commons/devices-mockup.png)](https://chirpy.cotes.info)
22+
[![Devices Mockup](https://cdn.jsdelivr.net/gh/cotes2020/chirpy-images@0a003683c0c3ca549d12c309f9b3e03ea20981e5/commons/devices-mockup.png)](https://chirpy.cotes.info)
2323

2424
</div>
2525

@@ -158,7 +158,7 @@ $ docker run -it --rm \
158158

159159
2. 回到 GitHub 上的仓库,选择标签 _Settings_ → 点击左侧导航栏的 _Pages__GitHub Pages_ 选择分支 `gh-pages``/(root)` 作为「[发布源][pages-src]」:
160160

161-
![gh-pages-sources](https://cdn.jsdelivr.net/gh/cotes2020/chirpy-images/posts/20190809/gh-pages-sources.png)
161+
![gh-pages-sources](https://cdn.jsdelivr.net/gh/cotes2020/chirpy-images@0a003683c0c3ca549d12c309f9b3e03ea20981e5/posts/20190809/gh-pages-sources.png)
162162

163163
3. 按照 GitHub 指示的地址去访问您的网站。
164164

tools/init.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,14 @@ init_files() {
5252
if $_no_gh; then
5353
rm -rf .github
5454
else
55-
# change the files of `.github`
55+
## Change the files of `.github`
56+
5657
mv .github/workflows/$ACTIONS_WORKFLOW.hook .
5758
rm -rf .github
5859
mkdir -p .github/workflows
5960
mv ./${ACTIONS_WORKFLOW}.hook .github/workflows/${ACTIONS_WORKFLOW}
6061

61-
# ensure the gh-actions trigger branch
62+
## Ensure the gh-actions trigger branch
6263

6364
_workflow=".github/workflows/${ACTIONS_WORKFLOW}"
6465
_default_branch="$(git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@')"
@@ -67,6 +68,10 @@ init_files() {
6768
sed -i.$TEMP_SUFFIX "$((_lineno + 1))s/- .*/- ${_default_branch}/" "$_workflow"
6869
rm -f "$_workflow.$TEMP_SUFFIX"
6970

71+
## Cleanup image settings in site config
72+
sed -i.$TEMP_SUFFIX "s/^img_cdn:.*/img_cdn: ''/;s/^avatar:.*/avatar: ''/" _config.yml
73+
rm -f _config.yml.$TEMP_SUFFIX
74+
7075
fi
7176

7277
# trace the gem lockfile on user-end

0 commit comments

Comments
 (0)