mirror of
https://github.com/cotes2020/jekyll-theme-chirpy.git
synced 2025-12-18 05:41:31 +00:00
refactor!: rename media-url file and related parameters (#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`
This commit is contained in:
committed by
Cotes Chung
parent
61bdca2db4
commit
9f8aeaadbf
@@ -247,14 +247,14 @@ The screenshots of the program window can be considered to show the shadow effec
|
||||
|
||||
### CDN URL
|
||||
|
||||
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:
|
||||
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:
|
||||
|
||||
```yaml
|
||||
img_cdn: https://cdn.com
|
||||
cdn: https://cdn.com
|
||||
```
|
||||
{: file='_config.yml' .nolineno}
|
||||
|
||||
Once `img_cdn` is assigned, the CDN URL will be added to the path of all images (images of site avatar and posts) starting with `/`.
|
||||
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 `/`.
|
||||
|
||||
For instance, when using images:
|
||||
|
||||
@@ -270,13 +270,13 @@ The parsing result will automatically add the CDN prefix `https://cdn.com` befor
|
||||
```
|
||||
{: .nolineno }
|
||||
|
||||
### Image Path
|
||||
### Media Subpath
|
||||
|
||||
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:
|
||||
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:
|
||||
|
||||
```yml
|
||||
---
|
||||
img_path: /img/path/
|
||||
media_subpath: /img/path/
|
||||
---
|
||||
```
|
||||
|
||||
@@ -308,7 +308,7 @@ image:
|
||||
---
|
||||
```
|
||||
|
||||
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.
|
||||
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.
|
||||
|
||||
For simple use, you can also just use `image` to define the path.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user