LoveIt icon indicating copy to clipboard operation
LoveIt copied to clipboard

[Question] How to disable featuredImage on home page

Open maaraoffl opened this issue 5 years ago • 3 comments

Describe the question 描述你遇到的错误

I would not like to have my posts featuredImage on home一page. Though, it should display on posts.

Expected behavior 期待的行为

Homepage should display posts without featuredImage

maaraoffl avatar Aug 09 '20 19:08 maaraoffl

hi @maheshvra

based on exampleSite folder, i see this config Image 1

try to remove it, maybe can solve your problem

yvza avatar Sep 02 '20 09:09 yvza

Describe the question 描述你遇到的错误

I would not like to have my posts featuredImage on home一page. Though, it should display on posts.

Expected behavior 期待的行为

Homepage should display posts without featuredImage

I approve, homepage not need display this image.

cityiron avatar Oct 09 '20 02:10 cityiron

What about this as an option:

  • Disable featuredImage and featuredImagePreview within the front matter of your post.
    • This ensures an image for this post does not display on the homepage of your site.
  • Add an image shortcode as the first element in your post: {{< figure src="/images/lighthouse.jpg" title="Lighthouse (figure)" >}}

So your index.md would look something like:

 ---
title: "My Post Title"
subtitle: ""
date: 2020-10-09
lastmod: 2020-10-09
draft: false
author: "  Ben Chapman"
hiddenFromHomePage: false

# featuredImage: ""
# featuredImagePreview: ""
---

{{< figure src="/images/lighthouse.jpg" title="Lighthouse (figure)" >}}

This is the content of my article...

Ben-Chapman avatar Oct 09 '20 12:10 Ben-Chapman