Installed hugo. Installed template. But localhost:1313 BLANK or ERROR

Please run the following three commands as a regular user and post what happens:

whoami
cd ~
pwd

Do not freak out. These are solvable problems and the nature of computing, especially Linux command line if you are new to it.:smiling_face_with_three_hearts:

1 Like

:grin: Thanks for the love _nm

zaesar@zaesar-X541UV:/home/zaesarpo$ whoami
zaesar
zaesar@zaesar-X541UV:/home/zaesarpo$ cd ~
zaesar@zaesar-X541UV:~$ pwd
/home/zaesar
zaesar@zaesar-X541UV:~$

should I have done this out of zaesarpo folder?

1 Like

No, please do not use the /home/zaesarpo directory. Your home directory is /home/zaesar (which is also known as ~ and ~zaesar) and in a subdirectory of there is where you should put your Hugo site files. At a command prompt, run the following commands as user zaesar:

cd ~
mkdir Site
cd ~/Site
ls -la

When you do ls -la you should see that this ~/Site directory contains only . and ..

Now do the following as user zaesar:

  1. Put your Hugo site files in the ~/Site directory. Do not copy them from any of the problem directories. Get them from GitHub or wherever the directions you are following specify.
  2. Make sure config.toml is in the ~/Site directory.
  3. Before you run any hugo command, make sure:
    • you are user zaesar - you can check this with whoami
    • you are in ~/Site - you can get there with cd ~/Site
    • you are not using sudo or root - do everything as regular user zaesar

If you have to use sudo or root to do anything, there is a problem.

Note that if you download a Hugo site directory from the net, e.g., from GitHub, you can put that directory into your home directory with whatever name you like. You do not need to name that directory Site. For example, if you name the directory FOOBAR, then all your hugo commands will be run from ~/FOOBAR.

I hope this helps :crossed_fingers::pray:

2 Likes

Jesus! _nm thank you so much for this clear explanation got cristal clear until this:

Why? Why I have to use sudo? Isn’t it wrong? Like this I’m again as root. So, this is in the documentation should I write this?

Really appreciate your time to bringing up light into this dark moments :bat:

I should have said “if you have to use sudo for anything other than installing the hugo executable, there is a problem.” Now you should be able to create a site, run hugo commands, etc. as a regular user.

Nice walk through by @_nm

@zaesarius Keep in mind there are other ways to install Hugo on Linux. The two post popular I know of are (1) via snap and (2) via downloading the binary yourself (which doesn’t require sudo, depending on where you save the binary)

Hi again,

Have been in silence for some days trying to read and to do it so perfectly as I could following your indications and looking to youtube tutorials, posts and the documentation.

First of all, thanks a lot to @_nm _nm and @zwbetz for helping really appreciate what you’re doing guys :pray:

Second I’ve stopped to use the sudo comand as it says on the oficial hugo documentation for Linux Debian. Have installed snap and could make it all whithout sudo as suggested by _nm

Here is how it looks my folders structure:

This was following the hugo youtube tutorial and have seen that there are some files differences from the video that from the one downloaded. Anyway…

Have also installed the theme on the theme folders as you can see on the image.

Now, have started hugo server. Nothing. Tried on diferent directories. Of course where Hugo is and got my WARN and ERROR friends again :disappointed_relieved:

zaesar@zaesar-X541UV:~/Hugo$ hugo server
Total in 0 ms
Error: Error building site: open /home/zaesar/Hugo/content: no such file or directory
zaesar@zaesar-X541UV:~/Hugo$ cd zaesarpo
zaesar@zaesar-X541UV:~/Hugo/zaesarpo$ hugo server
Building sites … WARN 2019/05/27 11:37:27 Page's .Hugo is deprecated and will be 
removed in a future release. Use the global hugo function.
ERROR 2019/05/27 11:37:27 render of "home" failed: execute of template failed: template: 
index.html:11:5: executing "index.html" at <partial "background.html" .>: error calling partial: 
"/home/zaesar/Hugo/zaesarpo/themes/hugo-dream-plus- 
master/layouts/partials/background.html:23:11": execute of template failed: template: 
partials/background.html:23:11: executing "partials/background.html" at <len $bgList>: error 
calling len: len of untyped nil
ERROR 2019/05/27 11:37:27 render of "taxonomyTerm" failed: execute of template failed: 
template: taxonomy/terms.html:11:5: executing "taxonomy/terms.html" at <partial 
"background.html" .>: error calling partial: "/home/zaesar/Hugo/zaesarpo/themes/hugo- 
dream-plus-master/layouts/partials/background.html:23:11": execute of template failed: 
template: partials/background.html:23:11: executing "partials/background.html" at <len 
$bgList>: error calling len: len of untyped nil
Total in 21 ms
Error: Error building site: failed to render pages: render of "taxonomyTerm" failed: execute 
of template failed: template: taxonomy/terms.html:11:5: executing "taxonomy/terms.html" at 
<partial "background.html" .>: error calling partial: 
"/home/zaesar/Hugo/zaesarpo/themes/hugo-dream-plus- 
master/layouts/partials/background.html:23:11": execute of template failed: template: 
partials/background.html:23:11: executing "partials/background.html" at <len $bgList>: error 
calling len: len of untyped nil

I’m a newbie and of course is my fault. But I’ve tried countless times to make it work I can’t see what I’m doing wrong.

Any suggestion would be really appreciated.

Whish you a nice day :vulcan_salute:

I’ve run it again and get this:

zaesar@zaesar-X541UV:~/Hugo/zaesarpo$ ls -l /tmp/hugo_cache/
total 8
drwxr-xr-x 3 zaesar zaesar 4096 may 23 15:23 home
drwxr-xr-x 3 root   root   4096 may 23 15:24 zaesarpo

So, it seems I’m still in root. Even if I deleted the other one and added this new whithout using sudo… :thinking:

I’m lost

So I think your hugo installation is fine at this point. Now you need to track down this template error:

Error: Error building site: failed to render pages: render of "taxonomyTerm" failed: execute 
of template failed: template: taxonomy/terms.html:11:5: executing "taxonomy/terms.html" at 
<partial "background.html" .>: error calling partial: 
"/home/zaesar/Hugo/zaesarpo/themes/hugo-dream-plus- 
master/layouts/partials/background.html:23:11": execute of template failed: template: 
partials/background.html:23:11: executing "partials/background.html" at <len $bgList>: error 
calling len: len of untyped nil

Is there a sintactic error on the original theme file?

I mean I haven’t touch anything on the file. Haven’t also added any images than the ones that brings by default.

Have wrote for 7 days to the theme issues part. But still got no answer…

Thanks for your support @zwbetz !

So in themes/hugo-dream-plus/layouts/partials/background.html there are these lines

{{ $colorBG := $.Site.Params.background.colorBG }}
{{ $bgList := $.Site.Params.background.bgList }}
{{ $bgBlur := $.Site.Params.background.bgBlur }}

Each of them reads a param from your config file. So make sure you have all those params set.
(Some themes set a default value for nil params, but this one does not).

Am also tagging the theme author for this, @UtkarshVerma

2 Likes

Again thank you for your help. HAve being playing around on the config file with those params but no result. Waitting for the author suppor @UtkarshVerma.

What I also see is this warning:

zaesar@zaesar-X541UV:~/Hugo/zaesarpo$ hugo server
Building sites … WARN 2019/05/28 16:43:27 Page's .Hugo is deprecated and will be 
removed in a future release. Use the global hugo function.

Does this warning not be also something to be aware? Thanks!

It’s something that will need to be fixed eventually (if you upgrade Hugo versions), but it isn’t stopping you from building your site

Thanks!

Good to know :+1:

@zaesarius, sorry for not being responsive. I didn’t have the time to get back to programming until today. Therefore I’ll start working on my theme from today.

2 Likes

Don’t worry @UtkarshVerma a really appreciate your work, love your theme. And it also was good for me to look around and learn some things. Let me know when I can get into it.

Whish you a good day!

1 Like

Hi @UtkarshVerma,

Hope you’re doing well :slight_smile:

Do you have any news about the update?

Thanks in advance :pray:

1 Like

Hi @zaesarius,
The theme is working fine with the latest Hugo version. Check it out. I’m currently revamping the whole theme currently, improving performance, content organization etc. as well therefore be ready for an even better major update within a couple of weeks.
Meanwhile, if you find a bug, please post an issue on GitHub.
P.S.: Glad you liked the theme.

Also, keep in mind to check the background documentation because there have been some changes in the config.

Thank you for your fast response.

I have seen what you mean about the changes. Have updated the new code on background.html:

<script>
var prevBgIndex = 0;
var bodyBgSwitchIndex = 0;
{{ $bgColor := $.Site.Params.background.color }}
{{ $bgImages := $.Site.Params.background.images }}
{{ $bgBlur := $.Site.Params.background.blur }}
{{ with $bgImages }}
    {{ if gt (len $bgImages) 1 }}
	    var images = {{ $bgImages }};
	    var randomNumber = getRandomInt(0, images.length);
	    var bgImage = "url(" + images[randomNumber] + ")";
    {{ else }}
	    var bgImage = "url(" + {{ index $bgImages 0 }} + ")";	
    {{ end }}
	    console.log("Current background: " + bgImage.substring(bgImage.indexOf("bg"), 
bgImage.length));
	    document.body.style.setProperty('--blurEff', {{ $bgBlur }});
	    document.body.style.backgroundImage = bgImage;	
{{ else }}
    {{ with $bgColor }}
	    document.body.style.backgroundColor = {{ $bgColor }};
    {{ else }}
	    var gradients = [
	      [],
	      ['#40e0d0', '#ff8c00', '#ff0080'], // Wedding Day Blues
	      ['#3e5151', '#decba4'], // Sand to Blue
	      ['#11998e', '#38ef7d'], // Quepal
	      ['#108dc7', '#ef8e38'], // Pun Yeta
	      ['#fc5c7d', '#6a82fb'], // Sublime Light
	      ['#fc466b', '#3f5efb'], // Sublime Vivid
	      ['#c94b4b', '#4b134f'], // Bighead
	      ['#23074d', '#cc5333'] // Taran Tado
	    ];
	    var randomBgColor = gradients[getRandomInt(0, gradients.length)].join(", ");
	    var backgroundProperty = 'linear-gradient(to right, ' + randomBgColor + ')';
	    document.body.style.background = backgroundProperty;
    {{ end }}
{{ end }}
function getRandomInt(min, max) {
  min = Math.ceil(min);
  max = Math.floor(max);
  var random;
  while (1) {
    random = Math.floor(Math.random() * (max - min)) + min;
    if (random !== prevBgIndex) {
      prevBgIndex = random;
      break;
    }
  }
  return random;
}
</script>

{{/*Create blur effect*/}}
{{ if $bgBlur }}
    <div class="blur-overlay"></div>
{{ end }}

Have also looked to the background documentation. As I understood I’ve to make some changes on the config.toml on params.background have seen that there was a similar issue and that’s why some params are now diferent.

	[params.background]
	    color = #fff
	    images = false
	    bgList = true
	    blur = true

I still have to be doing things wrong because I still get the error.

I also get an error on back.html and in terms.html but can’t figure out what is wrong :confused:

usr@usr:~/Hugo/zaesarpo$ hugo server
Building sites … WARN 2019/06/03 12:38:37 Page's .Hugo is deprecated and will be r 
removed in a future release. Use the global hugo function.
ERROR 2019/06/03 12:38:37 render of "taxonomyTerm" failed: execute of template failed: 
template: taxonomy/terms.html:20:8: executing "taxonomy/terms.html" at <partial 
"back.html" .>: error calling partial: "/home/zaesar/Hugo/zaesarpo/themes/hugo-dream- 
plus-master/layouts/partials/back.html:10:8": execute of template failed: template: 
partials/back.html:10:8: executing "partials/back.html" at <readFile "/content/about.md">: 
error calling readFile: stat /home/zaesar/Hugo/zaesarpo/content/content/about.md: no such 
file or directory
ERROR 2019/06/03 12:38:37 render of "taxonomyTerm" failed: execute of template failed: 
template: taxonomy/terms.html:20:8: executing "taxonomy/terms.html" at <partial 
"back.html" .>: error calling partial: "/home/zaesar/Hugo/zaesarpo/themes/hugo-dream- 
plus-master/layouts/partials/back.html:10:8": execute of template failed: template: 
partials/back.html:10:8: executing "partials/back.html" at <readFile "/content/about.md">: 
error calling readFile: stat /home/zaesar/Hugo/zaesarpo/content/content/about.md: no such 
file or directory
Total in 74 ms
Error: Error building site: failed to render pages: render of "home" failed: execute of 
template failed: template: index.html:20:8: executing "index.html" at <partial "back.html" .>: 
error calling partial: "/home/zaesar/Hugo/zaesarpo/themes/hugo-dream-plus- 
master/layouts/partials/back.html:10:8": execute of template failed: template: 
partials/back.html:10:8: executing "partials/back.html" at <readFile "/content/about.md">: 
error calling readFile: stat /home/zaesar/Hugo/zaesarpo/content/content/about.md: no such 
file or directory


Thanks a lot for your time :pray: