From 782a930fdf298739cd205de7708598ba96b3d276 Mon Sep 17 00:00:00 2001 From: Cotes Chung <11371340+cotes2020@users.noreply.github.com> Date: Fri, 18 Nov 2022 22:18:04 +0800 Subject: [PATCH] docs: update tutorial for defining preview image --- _posts/2019-08-08-write-a-new-post.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/_posts/2019-08-08-write-a-new-post.md b/_posts/2019-08-08-write-a-new-post.md index acea436..1395ece 100644 --- a/_posts/2019-08-08-write-a-new-post.md +++ b/_posts/2019-08-08-write-a-new-post.md @@ -243,7 +243,7 @@ If you want to add an image to the top of the post contents, specify the attribu ```yaml --- image: - path: /path/to/image/file + path: /path/to/image width: 1000 # in pixels height: 400 # in pixels alt: image alternative text @@ -254,7 +254,11 @@ Except for `alt`, all other options are necessary, especially the `width` and `h 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. -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. +For simple use, you can also just use `image` to define the path. + +```yml +image: /path/to/image +``` ## Pinned Posts