Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is Hugo serving blank pages?

Tags:

hugo

I am building a personal website using Hugo Static Page Generator, but when I do hugo serve, I am no longer seeing a page, but simply a blank page at localhost:1313.

I deleted everything and did a fresh install. But still, Hugo is serving blank pages.

In the blank page, I see the Favicon of the previous site draft I had, even though I deleted everything from the previous theme. I cleared the browser in Chrome and tried a different browser too, but it's still not working.

Not sure what information I can provide, as there are no error messages. How can I fix this?

like image 775
maximusdooku Avatar asked Apr 22 '17 05:04

maximusdooku


People also ask

What is Hugo and how do I use it?

The command hugo renders your site into public/ dir and is ready to be deployed to your web server: Hugo allows you to set draft, publishdate, and even expirydate in your content’s front matter.

Is Hugo server a high performance web server?

While hugo server is high performance, it is a webserver with limited options. Many run it in production, but the standard behavior is for people to use it in development and use a more full featured server such as Nginx or Caddy. ‘hugo server’ will avoid writing the rendered and served content to disk, preferring to store it in memory.

What is--navigatetochanged in Hugo?

It’s the flag --navigateToChanged. LiveReload works by injecting JavaScript into the pages Hugo generates. The script creates a connection from the browser’s web socket client to the Hugo web socket server. Or… config.

What happens when I make changes to my Hugo build?

Whenever you make changes, Hugo will simultaneously rebuild the site and continue to serve content. As soon as the build is finished, LiveReload tells the browser to silently reload the page. Most Hugo builds are so fast that you may not notice the change unless looking directly at the site in your browser.


2 Answers

The problem is likely to be the theme - it is either missing or broken. Hugo does not come with any default/fallback theme if you fail to provide a working one.

Debugging guide:

  1. Check the themes folder, and follow the quickstart.
  2. Try using another, simpler theme.
  3. It may only be a question of configuring the theme, you may read the hugo theme documentation too.
like image 90
jediz Avatar answered Sep 21 '22 13:09

jediz


Please verify your config.toml file points to right theme.

If following Quick start tutorial, you might have forgot to run

echo 'theme = "ananke"' >> config.toml 
like image 37
bhar1red Avatar answered Sep 21 '22 13:09

bhar1red