docs: update preview image's font-matter

This commit is contained in:
Cotes Chung 2022-03-16 19:49:57 +08:00
parent 9cefe58993
commit 67d51d5df2
No known key found for this signature in database
GPG key ID: 0D9E54843167A808
2 changed files with 4 additions and 4 deletions

View file

@ -9,7 +9,7 @@ tags: [typography]
math: true
mermaid: true
image:
src: /commons/devices-mockup.png
path: /commons/devices-mockup.png
width: 800
height: 500
---

View file

@ -221,12 +221,12 @@ The output will be:
### Preview Image
If you want to add an image to the top of the post contents, specify the attribute `src`, `width`, `height`, and `alt` for the image:
If you want to add an image to the top of the post contents, specify the attribute `path`, `width`, `height`, and `alt` for the image:
```yaml
---
image:
src: /path/to/image/file
path: /path/to/image/file
width: 1000 # in pixels
height: 400 # in pixels
alt: image alternative text
@ -235,7 +235,7 @@ image:
Except for `alt`, all other options are necessary, especially the `width` and `height`, which are related to user experience and web page loading performance. The above section "[Size](#size)" also mentions this.
Starting from _Chirpy v5.0.0_, the attributes `height` and `width` can be abbreviated: `height``h`, `width``w`. In addition, the [`img_path`](#image-path) can also be passed to the preview image, that is, when it has been set, the attribute `src` only needs the image file name.
Starting from _Chirpy v5.0.0_, the attributes `height` and `width` can be abbreviated: `height``h`, `width``w`. In addition, 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.
## Pinned Posts