I’m using a Raspberry Pi v2 running Jessie, and have installed Hugo following the ‘Quickstart guide’ ‘Bookshelf’ example, and everything appeared to go well down to Step 5, but at no stage have I managed to access the webpage at http://localhost:1313, I just get ‘Unable to connect’.
From the SSH I see;
Started building site
1 of 1 draft rendered
0 future content
1 pages created
0 non-page files copied
2 paginator pages created
0 tags created
0 categories created
in 194 ms
Watching for changes in /home/pi/hugo_working_dir/bookshelf/{data,content,layouts,static,themes}
Serving pages from memory
Web Server is available at http://localhost:1313/ (bind address 127.0.0.1)```
The things I've tried;
- 192.168.1.10 displays my current html website OK
- 192.168.1.10:8443 displays my node-red admin page OK
- Tried 127.0.0.1:1313/ & 192.168.1.10:1313/ - 'Unable to connect'
- Opening port 1313 in my router - 'Unable to connect'
- Tried running ``` $ netstat -4 -tln``` and get:
```active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 127.0.0.1:1313 0.0.0.0:* LISTEN
(plus the other connections)```
Any help would be appreciated.
Paul
So because I can wget the index.html file, this presumably means that Hugo has generated the page, yet I still can’t view it at localhost:1313 (discourse won’t let me enter the full url!!)
A further check of my hosts file shows;
Running wget on the same host should work fine. Your problem is that Hugo’s server can’t be accessed outside of your Raspberry Pi. Give the following command a try:
Started building site
=============================================================
Your rendered home page is blank: /index.html is zero-length
* Did you specify a theme on the command-line or in your
"config.toml" file? (Current theme: "")
* For more debugging information, run "hugo -v"
=============================================================
0 of 1 draft rendered
etc...```
If I try;
``` $ hugo server --theme=hugo_theme_robust --buildDrafts --bind "0.0.0.0"```
that takes me a bit further, and I can access the site at my Raspberry Pi's IP - 192.168.1.10:1313 (not by localhost:1313), but the theme is missing.
<img src="//cdck-file-uploads-canada1.s3.dualstack.ca-central-1.amazonaws.com/flex036/uploads/gohugo/original/2X/9/966e4a3a328ec901e14e364aabefc7d9586b9dda.png" width="690" height="185">
Thanks, yes that works!
I’m happy using 192.168.1.10:1313 and adding --bind & --baseURL to build the draft, but will this create me problems further down the road?
That’s good to hear Bjørn, I already have a domain and existing blog based on Markdown, but was blown away with Hugo.
I’m not as competent as perhaps other forum members, but I’m slowly getting there…