4

I seem to be having an issue with Hugo.

I am following their get started guide: https://gohugo.io/tutorials/creating-a-new-theme/

I have followed this steps:

1) Created new site:

$ hugo new site my-site

2) In that folder I then typed the command for the new theme:

$ hugo new theme mysite-theme

Every worked fine, the files are there. The problem is them when I try to render the site. I type in the command:

$ hugo

Which creates the /public folder and two files:

  • index.xml
  • sitemap.xml

However, according to the guide it is supposed to create 4 files:

  • index.html
  • index.xml
  • sitemap.xml
  • 404.html

Now, even though there is nothing to put in these files, it should still create the index.html and 404.html files.

Has anyone else encountered this problem? Have I done something wrong or missed a step?

Vertexwahn
  • 7,709
  • 6
  • 64
  • 90
JamesG
  • 1,552
  • 8
  • 39
  • 86

2 Answers2

8
  • I had the same issue. Be careful of git submodules.
  • When cloning a theme into your /themes folder you must delete the .git file or use git submodules correctly. Otherwise when you clone the chosen themes folder will be empty.

  • hugo -v will show errors.

snassr
  • 1,228
  • 14
  • 10
  • 1
    And this is the answer - missing theme. While cloning your blog repo, append a flag to clone also submodules as per [this question](https://stackoverflow.com/questions/3796927/how-to-git-clone-including-submodules) – adamczi Aug 05 '19 at 19:13
3

This is the correct default behavior of Hugo. Hugo does not generate empty pages by default, because you don't have any content generate. And no themes or layout with any instructions. This is very different compared to Jekyll e.g.

You can see a warning, if you use hugo -v in the command-line, that '/' is rendered empty.

Pyth0n
  • 355
  • 5
  • 13