-
Notifications
You must be signed in to change notification settings - Fork 305
-
Notifications
You must be signed in to change notification settings - Fork 305
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
featuredImg not generating relative paths after recent change #29
Comments
I recently add that absURL function so the url of |
I have other images in that folder, which I included in my post using the figure shortcode (you can see the images in my blog post) which Hugo generated as expected. It's not a big deal to leave it as is. Would you consider writing short Release Notes when you release a version, especially breaking changes, so existing users know what they need to update before getting latest? Thanks! |
I didn't know you can put images in content folder to be honest, I assume people put images under the static folder. What that After the recent theme update, You can use Internal template also use I totally didn't expect this to be a breaking change, but I will try to make my release notes as detailed as possible. |
Thanks for the detailed explanation! I’ll give the images tag a look.
One of Hugo’s strengths is it’s flexibility with how to structure content
hierarchy, which I guess makes it harder for theme makers to support the
different use cases.
I find putting blog post images in the same folder makes more sense for me
rather than the static folder. Similar to declaring variables close to
where you use them where possible.
Thanks for the great work and constant updates. If you put a donation link
of some kind I’m sure I can send you a little tip of gratitude.
This issue can be closed.
…On Tue, 8 Jan 2019 at 11:32 PM, Track3 ***@***.***> wrote:
I didn't know you can put images in content folder to be honest, I assume
people put images under the static folder. What that absURL function does
is they take a string and parse them with site's baseURL. In this
situation, they don't care where the image is actually located, the only
thing they can see is that string. I don't know why I'm so tempted to use
absURL, maybe I thought relative urls in inline css could cause problems,
and as you can see, if images are in static folder or they are external,
everything is fine.
After the recent theme update, You can use images instead of featuredImg,
images is already used in Hugo internal templates, so it's more
convenient to set up something like Twitter Cards or Facebook Opengragh.
You can see the example post here:
https://themes.gohugo.io//theme/hermit/posts/post-with-featured-image/. I
didn't remove the featuredImg field, in case you don't need those meta
tags. Same thing happened with that bgImg field, you can set homepage
background image with images in site's config.toml.
Internal template also use absURL function so if you put images in
content folder and set frontmatter with images, this will also produce
incorrect image urls. But that's another issue to fix. I think for now,
leave the featuredImg url untouched is fine.
I totally didn't expect this to be a breaking change, but I will try to
make my release notes as detailed as possible.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#29 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AIBH-DhyHVs-MBvY_uQ0t2I6T0sW0VB6ks5vBHPFgaJpZM4ZySPO>
.
|
Yeah, I agree with you, Hugo is really flexible, you can manage content however you like, and it's hard for a theme to take care of all scenarios. As for donation, it's fine, thank you for your support, I'm more than happy to see people actually using my theme, that's enough for me. |
Commit 1e17ccb somehow changed the behaviour of featuredImg so that it's no longer referencing relative paths correctly. Have a look at my page New Year, New Beginnings and see the developer console.
It is trying to load the featuredImg from https://www.coderfrontline.com/city-night-explosion-firework.jpg rather than https://www.coderfrontline.com/new-year-new-beginnings/city-night-explosion-firework.jpg.
My folder structure:
My front matter:
I used
git bisect
to determine that it started happening with commit 1e17ccb but I don't know enough about Hugo templates to advise the exact cause.Appreciate your good work - love the template!
The text was updated successfully, but these errors were encountered: