Skip to content

Commit 782a930

Browse files
committed
docs: update tutorial for defining preview image
1 parent da7d7e2 commit 782a930

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

_posts/2019-08-08-write-a-new-post.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ If you want to add an image to the top of the post contents, specify the attribu
243243
```yaml
244244
---
245245
image:
246-
path: /path/to/image/file
246+
path: /path/to/image
247247
width: 1000 # in pixels
248248
height: 400 # in pixels
249249
alt: image alternative text
@@ -254,7 +254,11 @@ Except for `alt`, all other options are necessary, especially the `width` and `h
254254

255255
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.
256256

257-
Starting from _Chirpy v5.2.0_, the property for the preview image is changed to `image.path`. If upgrading the theme from a prior version, you will have to update posts' metadata to use new image property.
257+
For simple use, you can also just use `image` to define the path.
258+
259+
```yml
260+
image: /path/to/image
261+
```
258262

259263
## Pinned Posts
260264

0 commit comments

Comments
 (0)