You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor!: rename media-url file and related parameters (cotes2020#1651)
- Changed variable `img_cdn` to `cdn` in site configuration file.
- Changed the variable defining the relative path of the image in the post from `img_url` to `media_subpath`
Copy file name to clipboardexpand all lines: _posts/2019-08-08-write-a-new-post.md
+7-7
Original file line number
Diff line number
Diff line change
@@ -247,14 +247,14 @@ The screenshots of the program window can be considered to show the shadow effec
247
247
248
248
### CDN URL
249
249
250
-
If you host the images on the CDN, you can save the time of repeatedly writing the CDN URL by assigning the variable `img_cdn` of `_config.yml`{: .filepath} file:
250
+
If you host the media resources on the CDN, you can save the time of repeatedly writing the CDN URL by assigning the variable `cdn` of `_config.yml`{: .filepath} file:
251
251
252
252
```yaml
253
-
img_cdn: https://cdn.com
253
+
cdn: https://cdn.com
254
254
```
255
255
{: file='_config.yml' .nolineno}
256
256
257
-
Once `img_cdn` is assigned, the CDN URL will be added to the path of all images (images of site avatarand posts) starting with `/`.
257
+
Once `cdn` is assigned, the CDN URL will be added to the path of all media resources (site avatar, posts' images, audio and video files) starting with `/`.
258
258
259
259
For instance, when using images:
260
260
@@ -270,13 +270,13 @@ The parsing result will automatically add the CDN prefix `https://cdn.com` befor
270
270
```
271
271
{: .nolineno }
272
272
273
-
### Image Path
273
+
### Media Subpath
274
274
275
-
When a post contains many images, it will be a time-consuming task to repeatedly define the path of the images. To solve this, we can define this path in the YAML block of the post:
275
+
When a post contains many images, it will be a time-consuming task to repeatedly define the path of the media resources. To solve this, we can define this path in the YAML block of the post:
276
276
277
277
```yml
278
278
---
279
-
img_path: /img/path/
279
+
media_subpath: /img/path/
280
280
---
281
281
```
282
282
@@ -308,7 +308,7 @@ image:
308
308
---
309
309
```
310
310
311
-
Note that the [`img_path`](#image-path) can also be passed to the preview image, that is, when it has been set, the attribute `path` only needs the image file name.
311
+
Note that the [`media_subpath`](#media-subpath) can also be passed to the preview image, that is, when it has been set, the attribute `path` only needs the image file name.
312
312
313
313
For simple use, you can also just use `image` to define the path.
0 commit comments