gethugothemes / bookworm-light-hugo

Bookworm is a clean and modern Hugo blog theme focused on high speed and support multiple authors.
https://gethugothemes.com/products/bookworm/?utm_source=bookworm_github&utm_medium=referral&utm_campaign=github_theme_about
101 stars 77 forks source link

How to update the temaplate to use Page Bundles? #39

Closed rahulrai-in closed 8 months ago

rahulrai-in commented 8 months ago

Currently, the template requires images to be placed in the static folder or the assets folder. Can you suggest the modification necessary to enable it to use Page Bundles?

I want to store the blog post and all associated images, including the hero image in the same folder.

tfsomrat commented 8 months ago

Hey @rahulrai-in, I am sorry, but I didn't understand what do you mean by page bundles. can you explain, or give me some link to learn more about it?

rahulrai-in commented 8 months ago

Apologies @tfsomrat I should have added a link to the feature. Here it is: https://gohugo.io/content-management/page-bundles/

tfsomrat commented 8 months ago

so you want to store all the images into a single folder right?

rahulrai-in commented 8 months ago

I want to store images of a blog post in the same folder as the blog post. For example, in the following organization (screenshot from the documentation link)

Screenshot_20240325-210030.png

I'd like to keep the my-post blog post's images: image-1, image-2 etc. in the folder of the blog post.

rahulrai-in commented 8 months ago

I have used this style of content organization in my other blog. See this for reference. This doesn't use Page Bundle though.

https://github.com/rahulrai-in/thecloudblog/tree/master/tcb%2Fcontent%2Fpost%2FAdd%20DevOps%20To%20Your%20Existing%20Dockerized%20Applications%20With%20Azure%20DevOps%20Projects

tfsomrat commented 8 months ago

you can use this image partial: https://github.com/gethugothemes/hugo-modules/blob/master/images/layouts/partials/image.html

it has every functionality for loading image from assets/static/content/remote. just read the docs to use it properly.

Or you can hire us to do it for you at https://gethugothemes.com/get-a-quote

rahulrai-in commented 8 months ago

I tried editing the partial template. However, for some reason it is not able to fetch Page reaources.

The command .Page.Resources.Get return nil in the template.