From 67d51d5df2ad258aeeec6a99e6d41e42592a14cb Mon Sep 17 00:00:00 2001 From: Cotes Chung <11371340+cotes2020@users.noreply.github.com> Date: Wed, 16 Mar 2022 19:49:57 +0800 Subject: [PATCH] docs: update preview image's font-matter --- _posts/2019-08-08-text-and-typography.md | 2 +- _posts/2019-08-08-write-a-new-post.md | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/_posts/2019-08-08-text-and-typography.md b/_posts/2019-08-08-text-and-typography.md index cf38af4..23f7c03 100644 --- a/_posts/2019-08-08-text-and-typography.md +++ b/_posts/2019-08-08-text-and-typography.md @@ -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 --- diff --git a/_posts/2019-08-08-write-a-new-post.md b/_posts/2019-08-08-write-a-new-post.md index c52c2f1..4696e31 100644 --- a/_posts/2019-08-08-write-a-new-post.md +++ b/_posts/2019-08-08-write-a-new-post.md @@ -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