lukeorth / poison

Professional Hugo theme for dev bloggers. Based on Mdo's classic Hyde theme.
https://poison.lukeorth.com
GNU General Public License v3.0
205 stars 97 forks source link

Images not displaying in posts on main page #67

Closed kmkrebs closed 1 year ago

kmkrebs commented 1 year ago

I'm think this is more my ignorance than an issue, but when I have images in a post they don't appear on the main page. To see them you need to click on the post itself.

I have previously used the Strange Case theme and this worked as I expected it to.

I tried consulting the Hugo documentation, but it was a bit over my head. It's certainly not a show-stopper, but if anyone knows how to get this working, I would appreciate it.

thanks,

lukeorth commented 1 year ago

Hi @kmkrebs, thank you for the question! Hopefully this helps others that might experience similar issues.

Hugo has several different ways of rendering content summaries. It sounds like you're using automatic summary splitting, which takes the first 70 words of content by default and displays that. From my experience, this doesn't typically capture images or other "non-word" HTML elements.

My workaround for this is to use manual summary splitting with the <!--more--> divider. Any content above this divider will be included in the summary, including images.

Here's an example: image image

kmkrebs commented 1 year ago

Thank you! It's such a simple and elegant solution. I hope this helps others too.