We manage our content structure with hugo page bundle functionality.
It is a convenient way to organize article assets.
It also allows us to make use of image processing build in hugo. We use image processing in hugo to automatically resize and compress images.
We got image processing working with a schortcode from this article.
It appears that setting image = "main_image.jpg" in article front matter only works with image files stored in static/images/ folder.
Front matter does not recognize images that are bundled with the article, like this:
├── posts
│ ├── my-post
│ │ ├── main_image1.jpg
│ │ └── index.md
│ └── my-other-post
│ ├── images
│ │ └── main_image2.jpg
│ └── index.md
Is there a way to get post thumbnail and main image working with files from page bundle?
Perhaps we need to update layouts/index.html and layouts/_default/single.html` to make it work.
I am very new to Go and Hugo template, so I need your help.
Not sure, but perhaps the issues are somewhere here:
|
{{ $bg := (absURL (printf "images/%s" $image)) }} |
|
<img src = '{{ absURL (printf "images/%s" .) }}' alt = '{{ . }}' class = 'post_thumbnail'> |
Would appreciate your help.
We manage our content structure with hugo page bundle functionality.
It is a convenient way to organize article assets.
It also allows us to make use of image processing build in hugo. We use image processing in hugo to automatically resize and compress images.
We got image processing working with a schortcode from this article.
It appears that setting
image = "main_image.jpg"in article front matter only works with image files stored instatic/images/folder.Front matter does not recognize images that are bundled with the article, like this:
Is there a way to get post thumbnail and main image working with files from page bundle?
Perhaps we need to update
layouts/index.htmland layouts/_default/single.html` to make it work.I am very new to Go and Hugo template, so I need your help.
Not sure, but perhaps the issues are somewhere here:
newsroom/layouts/index.html
Line 13 in 4886891
newsroom/layouts/_default/single.html
Line 10 in 4886891
Would appreciate your help.