Skip to content
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

Hero image not sought or 404 #19

Closed
davebrothers opened this issue Apr 28, 2017 · 4 comments
Closed

Hero image not sought or 404 #19

davebrothers opened this issue Apr 28, 2017 · 4 comments

Comments

@davebrothers
Copy link

davebrothers commented Apr 28, 2017

When running in localhost with hugo server, hero image cannot be found and sometimes isn't even looked for.

Have tried:

  • Specifying in site config.toml featured_image -- Does not appear to be respected at all; Network tab shows no attempt to find file
  • Specifying in content/_index.md front matter featured_image: 'static/images/file.jpg' -- Site tries to pull from //localhost:1313/static/images/file.jpg but always 404s.
  • Copying the specified hero image to (site root)/static/images/file.jpg, (site root)/content/static/images/file.jpg and same structures inside theme folder.

Did I fall asleep in class and just miss something? 😴

@budparr
Copy link
Member

budparr commented Apr 28, 2017

Thank you, @Eidolonic It's very likely something I did trying to get the URLs to work on any instance, including where the install is in a nested folder. I'll have a look tonight.

@budparr
Copy link
Member

budparr commented Apr 30, 2017

Hey, @Eidolonic

Specifying in site config.toml featured_image -- Does not appear to be respected at all; Network tab shows no attempt to find file

At some point I changed this to not use a config default because I felt like the behavior should be not to have anything if you didn't have an image on the page. If you want the default from the config, I can show you how to do that {{ $featured_image := .Params.featured_image | default .Site.Params.featured_image }}

Specifying in content/_index.md front matter featured_image: 'static/images/file.jpg' -- Site tries to pull from //localhost:1313/static/images/file.jpg but always 404s.

The reference should not include static

Copying the specified hero image to (site root)/static/images/file.jpg, (site root)/content/static/images/file.jpg and same structures inside theme folder.

"(site root)/static/images/file.jpg" looks right to me.

I tested the theme with the sample content and it seems to work okay. If you want to post your repo, I'm happy to have a look.

@davebrothers
Copy link
Author

@budparr Thanks for your detailed response and sorry for squirreling you on a non-issue. Simply removing the static portion of the front matter reference fixed the problem. Thought I had tried that, but clearly not. 😎 Thanks for a killer theme.

@budparr
Copy link
Member

budparr commented May 1, 2017

Awesome! Glad to hear you got it figured out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants