Add image CDN tutorial
This commit is contained in:
parent
66a132c462
commit
93fcf50131
1 changed files with 26 additions and 4 deletions
|
@ -118,22 +118,44 @@ By default, the image is centered, but you can specify the position by using one
|
|||
Image will be left aligned in below sample:
|
||||
|
||||
```markdown
|
||||
{: width="350" .normal}
|
||||
{: .normal}
|
||||
```
|
||||
|
||||
- **Float to the left**
|
||||
|
||||
```markdown
|
||||
{: width="240" .left}
|
||||
{: .left}
|
||||
```
|
||||
|
||||
- **Float to the right**
|
||||
|
||||
```markdown
|
||||
{: width="240" .right}
|
||||
{: .right}
|
||||
```
|
||||
|
||||
> **Limitation**: Once you specify the position of an image, it is forbidden to add the image caption.
|
||||
**Limitation**: Once you specify the position of an image, it is forbidden to add the image caption.
|
||||
|
||||
### 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` file:
|
||||
|
||||
```yaml
|
||||
img_cdn: https://cdn.com
|
||||
```
|
||||
|
||||
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 `/`.
|
||||
|
||||
For instance, when using images:
|
||||
|
||||
```markdown
|
||||

|
||||
```
|
||||
|
||||
The parsing result will automatically add the CDN prefix `https://cdn.com` before the image path:
|
||||
|
||||
```html
|
||||
<img src="https://cdn.com/path/to/flower.png" alt="The flower">
|
||||
```
|
||||
|
||||
## Pinned Posts
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue