New Hugo Deployment on Debian fails to parse

pi@retropie : ~/hugo/philotechtech $ hugo server
Error: “/home/pi/hugo/philotechtech/themes/ananke/layouts/partials/func/GetFeaturedImage.html:35:1” : parse failed: template: partials/func/GetFeaturedImage.html:35: function “return” not defined

I made no changes to the theme itself. I followed the getting started document exactly. I can’t find an answer to this on your forum, search engine, or knowledge base.

How do I fix this? Thanks.

Which version of Hugo are you running. Type hugo version and paste the results.

Hugo Static Site Generator v0.54.0/extended linux/arm BuildDate: 2019-06-04T19:16:36Z

It looks like the return keyword was added in v0.55. The current version is v0.74.3.

Please upgrade.

That got me a lot further! Thanks. Now I’m getting this error when I run hugo server:
pi@retropie : **~/hugo/philotechtech ** hugo server ERROR: ld.so: object '/usr/lib/arm-linux-gnueabihf/libarmmem-{PLATFORM}.so’ from /etc/ld.so.preload cannot be preloaded (cannot open shared object file): ignored.
ERROR: ld.so: object ‘/usr/lib/arm-linux-gnueabihf/libarmmem-${PLATFORM}.so’ from /etc/ld.so.preload cannot be preloaded (cannot open shared object file): ignored.

The server starts, but I don’t get anything out of the url and port.

How did you install Hugo?

sudo snap install hugo --channel=extended

This might be related to the snap installation. Use an alternate method. See:
https://gohugo.io/getting-started/installing/#linux

Note that you can’t run the extended version on a Raspberry Pi.
See https://github.com/gohugoio/hugo/releases.

I compiled it using the instructions on the site, and it works now without error. However, when I try to load the site, it gives me a can’t connect error. Do I need to adjust the web server settings somehow? Thanks again!

From where are you trying to connect, and to what?

I have the Pi4 on my home network. 192.168.254.22:1313 That is the static lan ip of the pi4. The pi4 is accessible at that ip via many other ports for other services from my iMac. I’m definitely getting something wrong. Please help and thank you.

First, while Hugo includes the ability to serve pages via hugo server, this capability is intended for development use only.

Second, what command line do you run to start hugo server?

Also, have you tried to use bind? (ie.: hugo server --bind="0.0.0.0")

Uh. server should be used for development only, see: Hosting & Deployment.

1 Like

“First, while Hugo includes the ability to serve pages via hugo server , this capability is intended for development use only.”
I guess I didn’t comprehend the purpose of Hugo then. I thought it was a static style replacement for Wordpress or Joomla. If it isn’t for serving pages, what is it for? I would like to use it for its intend purpose if so.

I just used “hugo server”.

markdown + assets + templates --> hugo --> html + assets

Then deploy html + assets to a production server (apache, nginx, etc.) or service (Netlify, GitHub Pages, etc.).

hugo server provides a local preview of html + assets while you’re developing the site or creating new content.

1 Like

That’s awesome, jmooring. You’ve been great! That should cover all of my questions. Hopefully this thread will help others with the same questions.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.