binokochumolvarghese / lightbi-hugo

Lightbi is a minimal and clean blog theme for Hugo.
https://lightbi-hugo-theme.netlify.app/
MIT License
64 stars 36 forks source link

Attempt to load images from page bundles first #37

Closed palant closed 6 months ago

palant commented 6 months ago

Currently, lightbi will expect article images to be global. This isn’t optimal for organizing content, that’s why page bundles exist. With this change, images will be retrieved from the respective page bundles first. Global resources are only being used as fallback.

Note that Resources.Get will never return an object with an .Err property from what I can tell – it will either produce an image or nothing.

palant commented 6 months ago

I added one more commit, making certain the post image is only displayed automatically if it isn’t otherwise present in the content already. This allows for a more appropriate presentation while keeping the image in the preview card.

binokochumolvarghese commented 6 months ago

Thank you for your valuble contibutions.