Problem with displaying image in Hugo Server

Hi, I’m starting out with Hugo and am running into some issues. When I set up my first trial site the picture I put in is missing, when running it with hugo server.
Looking at the output I see "Using config file: ", i.e. empty, no config file is used.

I don’t see a way to upload files to this board so I’ll include the text files in this message below.

The image is in the md file: ![Leo](/static/img/bosleosmal.jpg) (without the esc…)

Paths correct, also casing is good.

Hope someone can help.
Cheers,
Frank

config.toml:
baseurl = "http://localhost:1313/"
languageCode = "en-us"
title = "harland.tk"
dateformat = "Monday, Jan 2, 2006"
theme = “hugo-bootstrap”

relativeURLs = true
canonifyURLs = true

[params]
description = "Frank’s Excellent and Awesome Hugo Site"
author = “harsites”

paginate = 3

disqusShortname = "xxxxxx"
googleAnalytics = “UA-XXXXXXX-1”

[[menu.main]]
name = "TAGS"
pre = ""
weight = -110
identifier = "tags"
url = “/tags/”

[[menu.main]]
name = "CATEGORIES"
pre = ""
weight = -100
identifier = "categories"
url = “/categories/”

[[menu.main]]
name = "ABOUT ME"
pre = ""
weight = -90
identifier = "about-me"
url = “/page/about-me”

[[menu.footer]]
name = "DISCLAIMER"
weight = -110
identifier = "disclaimer"
url = “/page/disclaimer/”

[[menu.footer]]
name = "LICENSE"
weight = -120
identifier = "license"
url = “/page/license/”

[params.widgets]
recent_articles = true
categories = true
tags = true
tag_cloud = true


post.md:
+++
author = "Frank Harland"
keywords = [
“harland”,
“home”,
]
date = "2017-02-21T21:50:39+01:00"
draft = “False”

description = "Thuispagina Harland"
tags = [
“introduction”,
]
title = "h a r l a n d . t k"
type = “page”
+++

Leo

Gegroet lezer, u heeft de site van de familie Harland bereikt.


Hier treft u

  • stof tot nadenken
  • foto’s
  • onzinnigheden en zinnelijkheden

Verder hulp bij het computeren en componenten als de Twitter timeline.

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Background Hugo showing picture problem
os x 10.11.3 (15D21)

Hugo 0.19
Using Sublime text3

Starting Server:
MacBook-Pro-Frank:harland.tk Frank$ hugo serve -wDs ~/Documents/Dev/hugo/harland.tk/ -v --config config.toml
INFO 2017/03/12 21:11:47 Using config file:
INFO 2017/03/12 21:11:47 using a UnionFS for static directory comprised of:
INFO 2017/03/12 21:11:47 Base: /Users/Frank/Documents/Dev/hugo/harland.tk/themes/hugo-bootstrap/static
INFO 2017/03/12 21:11:47 Overlay: /Users/Frank/Documents/Dev/hugo/harland.tk/static/
INFO 2017/03/12 21:11:47 syncing static files to /
WARN 2017/03/12 21:11:47 Translation func for language en not found, use default.
WARN 2017/03/12 21:11:47 i18n not initialized, check that you have language file (in i18n) that matches the site language or the default language.
Started building sites …
INFO 2017/03/12 21:11:47 found taxonomies: map[string]string{“tag”:“tags”, “category”:“categories”}
ERROR 2017/03/12 21:11:47 .Page’s Use RSSlink is deprecated and will be removed in Hugo 0.2. RSSLink.
WARNING: Page’s Now is deprecated and will be removed in a future release. Use now (the template func).
Built site for language en:
0 draft content
0 future content
0 expired content
1 regular pages created
3 other pages created
0 non-page files copied
1 paginator pages created
1 tags created
0 categories created
total in 4 ms
WARN 2017/03/12 21:11:47 Skip i18nDir: lstat /Users/Frank/Documents/Dev/hugo/harland.tk/i18n: no such file or directory
Watching for changes in /Users/Frank/Documents/Dev/hugo/harland.tk/{data,content,layouts,static,themes}
WARN 2017/03/12 21:11:47 Skip i18nDir: lstat /Users/Frank/Documents/Dev/hugo/harland.tk/i18n: no such file or directory
Serving pages from memory
Web Server is available at http://localhost:1313/ (bind address 127.0.0.1)
Press Ctrl+C to stop
^C

Tried to start Hugo with complete path, result below:

MacBook-Pro-Frank:harland.tk Frank$ hugo serve -wDs ~/Documents/Dev/hugo/harland.tk/ -v --config string ~/Documents/Dev/hugo/harland.tk/config.toml
Error: Unable to locate Config file. Perhaps you need to create a new site.
       Run `hugo help new` for details. (Unsupported Config Type "")

static isn’t carried over as static. Everything in that folder is carried over as-is at built time. So try…

![Leo](/img/bosleosmal.jpg)

Assuming you have yourproject/static/img/bosleosmal.jpg in your directory structure, this should work.
HTH.

To the missing config issue.
In which folder are you when running hugo? is it the same folder as the config file exists

@harri00413 Were you able to get this resolved?

Hi rac2030, Yes, the config.toml (in original post) is in the very directory the hugo server is started from. Somehow it must get the info from the config file, as the site now is working with the hugo server but when I start hugo to build the site the config is read but no layout is used. See uploaded pic (i found the upload button!).

Are you getting any errors/404s in the console in your browser’s developer tools (F12)?

Hi, As you can probably see in my reply to rac2030 the image issue is resolved, but still, when starting hugo from the site ‘home’ directory the text I see is as below, no usage of config.toml file indicated and no layout is used. That is strange because it does say in the log info:

INFO 2017/03/13 19:45:54 using a UnionFS for static directory comprised of:
INFO 2017/03/13 19:45:54 Base: /Users/Frank/Documents/Dev/hugo/harland.tk/themes/hugo-bootstrap/static
INFO 2017/03/13 19:45:54 Overlay: /Users/Frank/Documents/Dev/hugo/harland.tk/static/

I use Sublime text3 (of which I read about having some issues with line-ends) and work on a macbook. Could it be the hugo-bootstrap theme that isn’t working properly?

Info from starting hugo -v:

MacBook-Pro-Frank:harland.tk Frank$ hugo -v
INFO 2017/03/13 19:45:54 Using config file:
INFO 2017/03/13 19:45:54 using a UnionFS for static directory comprised of:
INFO 2017/03/13 19:45:54 Base: /Users/Frank/Documents/Dev/hugo/harland.tk/themes/hugo-bootstrap/static
INFO 2017/03/13 19:45:54 Overlay: /Users/Frank/Documents/Dev/hugo/harland.tk/static/
INFO 2017/03/13 19:45:54 syncing static files to /Users/Frank/Documents/Dev/hugo/harland.tk/public/
WARN 2017/03/13 19:45:54 Translation func for language en not found, use default.
WARN 2017/03/13 19:45:54 i18n not initialized, check that you have language file (in i18n) that matches the site language or the default language.
Started building sites …
INFO 2017/03/13 19:45:54 found taxonomies: map[string]string{“tag”:“tags”, “category”:“categories”}
ERROR 2017/03/13 19:45:54 .Page’s Use RSSlink is deprecated and will be removed in Hugo 0.2. RSSLink.
WARNING: Page’s Now is deprecated and will be removed in a future release. Use now (the template func).
Built site for language en:
0 draft content
0 future content
0 expired content
1 regular pages created
3 other pages created
0 non-page files copied
1 paginator pages created
1 tags created
0 categories created
total in 6 ms
MacBook-Pro-Frank:harland.tk Frank$

Not in your OS X terminal. You mentioned that styles aren’t rendering, so I’m wondering whether it’s just an issue of the stylesheet not being loaded.

Looking at the webinfo from browser I see resources not being found because it is looking for http://localhost:1313/assets/css/bootstrap.min.css a.s.o. Ha there you have it. That serves me right for copying one of the examples and put baseurl = “http://localhost:1313/” in the config.

I try it on my internet provider server and see what happens. I think we can close it for now.

[Error] Failed to load resource: Geen verbinding met de server mogelijk. (bootstrap.min.css, line 0)
[Error] Failed to load resource: Geen verbinding met de server mogelijk. (tether.min.js, line 0)
[Error] Failed to load resource: Geen verbinding met de server mogelijk. (tomorrow-night.css, line 0)
[Error] Failed to load resource: Geen verbinding met de server mogelijk. (bootstrap.min.js, line 0)
[Error] Failed to load resource: Geen verbinding met de server mogelijk. (script.js, line 0)

Honest mistake. Just remember that this value is auto-magically set on your local server when running hugo server so be sure to populate with the appropriate value for your deployment :smile: Glad it all worked out. Cheers.

Thanks very much. I’m trying to switch from Drupal to static with Hugo as my first trial (and error). It’s still hard if you’re not a hardcore programmer to get the hang of it. You can do so many things wrong, that you almost give up.

1 Like

Don’t give up just yet. This community is awesome, and once you get the hang of it, you’ll be spitting out new Hugo sites a few times a week. Cheers!