From 5757a5d453d1b389eec3af65b8dc2477ade9a4f0 Mon Sep 17 00:00:00 2001 From: Matt Popovich Date: Thu, 21 Nov 2024 02:39:13 -0700 Subject: [PATCH] feat: add support for image.show_image_in_post --- _layouts/post.html | 15 +++++++++------ _posts/2019-08-08-write-a-new-post.md | 1 + 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/_layouts/post.html b/_layouts/post.html index c8c21ef79..e8afc8750 100644 --- a/_layouts/post.html +++ b/_layouts/post.html @@ -45,12 +45,15 @@ script_includes: {%- capture lqip -%}lqip="{{ page.image.lqip }}"{%- endcapture -%} {% endif %} -
- - {%- if page.image.alt -%} -
{{ page.image.alt }}
- {%- endif -%} -
+ {% if page.image.show_image_in_post != false %} +
+ + {%- if page.image.alt -%} +
{{ page.image.alt }}
+ {%- endif -%} +
+ {% endif %} + {% endif %}
diff --git a/_posts/2019-08-08-write-a-new-post.md b/_posts/2019-08-08-write-a-new-post.md index 69eaf34ac..87162522e 100644 --- a/_posts/2019-08-08-write-a-new-post.md +++ b/_posts/2019-08-08-write-a-new-post.md @@ -227,6 +227,7 @@ image: ``` Note that the [`media_subpath`](#url-prefix) can also be passed to the preview image, that is, when it has been set, the attribute `path` only needs the image file name. +Additionally, `image.show_image_in_post` can be added and set to `false` which will hide the image from being displayed at the top of the post. However, the image will still be displayed on the homepage next to the post and whenever sharing the post in social media. `image.show_image_in_post` is `true` by default. For simple use, you can also just use `image` to define the path.