-
Notifications
You must be signed in to change notification settings - Fork 114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set post thumbnail image file from page bundles #6
Comments
@solrayc, I'll look into it and advise accordingly. |
After a bit of research, I came across something that could help https://discourse.gohugo.io/t/solved-media-in-separate-folder-and-accessing-with-page-resources/11756. It may take me a while to go through the repo making the necessary changes. If you need this urgently, you could apply this to your instance of the theme. |
I'll try to apply it and will let you know if it worked out. Thanks for pointing me in the right direction. |
After some research and inspiration from this post, I managed to get it working in single.html layout. I replaced newsroom/layouts/_default/single.html Lines 9 to 11 in 4886891
with this:
Exact sizing need to be worked on. Inspired by code from gohugoio theme: @onweru Can you please advise what sizes work best for this theme? index.html looks more complicated than single.html. Not sure if I'll get it. Will let you know if I can make it work. Lines 7 to 13 in 4886891
|
Finally got index.html layout working. See my code below. Feel free to close this issue, as I found solution to my issue. Thank you for this great theme. layouts/index.html
|
Awesome.
That must suck.
I will keep this issue open until I find the time to wholy solve it.
As of now, there are no recommended sizes of images. I use this theme for my blog and my approach towards image sizing is rather simplistic. I stick to a max-width of 1440px (720~1440). As such there's a massive room for improvement.
You're most welcome, thanks for contributing. |
A bit off topic
You can find the shortcode we use to resize images in text body here. |
Awesome, thanks |
Is there any chance to have this merged one day ? |
It's not a PR, so I guess no. |
I have this same issue but with your other theme @onweru |
I was to reference this issue actually. The thing is, I haven’t yet had the time to work on page bundles. We discussed it in this other theme chipzoller/hugo-clarity#72 (comment) and I haven’t moved on it yet. Let me see if I can squeeze in some time in the coming days and add support. |
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.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:
newsroom/layouts/index.html
Line 13 in 4886891
newsroom/layouts/_default/single.html
Line 10 in 4886891
Would appreciate your help.
The text was updated successfully, but these errors were encountered: