There is no page in public data when I run "hugo"

I have built a website in Hugo based on Dimension theme and when I test it locally on localhost it works nicely. I have 74 pages in the content folder. The folder structure is like this:
website
config.toml

  • content
  • public
    -css
    -en
    -fontd
    • images
      -js
      -sass
      index.html
      sitemap.xml
  • themes
    -dimension

In the website folder I type hugo and it creates the public folder. But I do not see any of the 74 pages I have under content folder. Here is the output when I type hugo:

Although it says it has built 74 regular pages, but I don’t see any under public folder. what could be the reason?

If you do:

 hugo --verbose

… in your project folder, you can get more information while it generates. See if there are any errors returned…

@RickCogley thank you very much for your help. I did that and I get a lot of WARN messages. For example Here are a few of them:

WARN 2017/06/05 05:51:53 Translation func for language en not found, use default.
WARN 2017/06/05 05:51:53 i18n not initialized, check that you have language file (in i18n) that matches the site language or the default language.
WARN 2017/06/05 05:51:53 Translation func for language de not found, use default.
WARN 2017/06/05 05:51:53 i18n not initialized, check that you have language file (in i18n) that matches the site language or the default language.
Started building sites …
WARN 2017/06/05 05:51:53 blog.html is rendered empty
WARN 2017/06/05 05:51:53 page1.html is rendered empty
WARN 2017/06/05 05:51:53 page2.html is rendered empty
…
WARN 2017/06/05 05:51:53 [en] Unable to locate layout for page : [taxonomy/tag.terms.html _default/terms.html indexes/indexes.html theme/taxonomy/tag.terms.html theme/_default/terms.html theme/indexes/indexes.html theme/taxonomy/tag.terms.html theme/_default/terms.html theme/indexes/indexes.html theme/theme/taxonomy/tag.terms.html theme/theme/_default/terms.html theme/theme/indexes/indexes.html]
WARN 2017/06/05 05:51:53 tags is rendered empty
WARN 2017/06/05 05:51:53 404.html is rendered empty

Do I need to fix the warnings?
Is there any specific one that shows what is the problem?

I just created a new website and just copied the config.toml from example site to the website, without any other change and using Dimension theme I ran hugo --verbose and got this:

INFO 2017/06/05 06:34:02 Using config file:
INFO 2017/06/05 06:34:02 using a UnionFS for static directory comprised of:
INFO 2017/06/05 06:34:02 Base: /Users/tj/Projects/Hugo_projects/testDimension/website/themes/dimension/static
INFO 2017/06/05 06:34:02 Overlay: /Users/tj/Projects/Hugo_projects/testDimension/website/static/
INFO 2017/06/05 06:34:02 syncing static files to /Users/tj/Projects/Hugo_projects/testDimension/website/public/
WARN 2017/06/05 06:34:02 Translation func for language en not found, use default.
WARN 2017/06/05 06:34:02 i18n not initialized, check that you have language file (in i18n) that matches the site language or the default language.
WARN 2017/06/05 06:34:02 Translation func for language de not found, use default.
WARN 2017/06/05 06:34:02 i18n not initialized, check that you have language file (in i18n) that matches the site language or the default language.
Started building sites …
INFO 2017/06/05 06:34:02 found taxonomies: map[string]string{“tag”:“tags”, “category”:“categories”}
WARN 2017/06/05 06:34:02 page1.html is rendered empty
WARN 2017/06/05 06:34:02 404.html is rendered empty
Built site for language en:
0 draft content
0 future content
0 expired content
1 regular pages created
1 other pages created
0 non-page files copied
0 paginator pages created
0 categories created
0 tags created
WARN 2017/06/05 06:34:02 404.html is rendered empty
Built site for language de:
0 draft content
0 future content
0 expired content
0 regular pages created
1 other pages created
0 non-page files copied
0 paginator pages created
0 tags created
0 categories created
total in 6 ms

I was able to create public folder with all my pages as html using another theme (about a month ago).
I am running this on macOS Sierra 10.12.5, is it possible that there is something wrong with my mac OS?

UPDATE1: I did this with another theme and got the same problem :frowning: , do I need to update Hugo or any other software on my machine?

UPDATE2: I tested this with my older website which used theme casper. I deleted the public folder and after typing hugo --verbose it generated public folder and correct html files. So it does not look like issue is related to my machine OS.

Hi - can you please provide a link to a github project, so we can see what you’re trying to do?

Also, what does this return:

 hugo env

@RickCogley thank you so much for your help Rick.
here is what hugo env returns:

website hugo env
Hugo Static Site Generator v0.19 darwin/amd64 BuildDate: 2017-02-27T02:21:29-08:00
GOOS="darwin"
GOARCH="amd64"
GOVERSION="go1.8"

It looks like as this is a single page theme, it puts all the content and all the data in the different .md files in index.html.

I don’t have a Github project, but here is a link to the website I am building.

this is hosted on Google Cloud Storage. Please take a look and see how slow is the loading time. I guess the reason is I have a lot of .md files and when I run hugo to build a public folder it combines all those files and add them to index.html and makes it a very large file. Also as I have a lot of links in each of those .md files I guess as all of them are in one file the load time is too slow. I just used inspect of Google Chrome and noticed there are about 1000 requests! Is there a way to limit the requests to only when a specific link is clicked?

I appreciate any feedback or help on how to proceed and make the website much faster. Currently, it takes about 10 sec to load the website.

Your problem regarding the link requests is not Hugo related I’m afraid.

Do you prerender those links on your index? If yes then that’s why you see these requests.

@tooraj, you can make a github project, or gitlab, or bitbucket or anything, if you are still having trouble with the content not being generated. Something so we can see the files and determine what’s possibly going wrong. Your hugo env shows your environment is relatively new so, I think it’s probably not a problem. (Note that 0.19 is not the latest hugo however)

As for the requests, as @alexandros says, it’s not hugo. Rather, that’s a design issue in my opinion too. Hugo is not involved once you build the site.

I use a Mac too, and zsh with some functions to make my life easier. I have a bunch for hugo server the gist of which are:

function hugoserver-1 {
     cd ~/path/to/1
     hugo server --buildDrafts --watch --verbose --source="/path/to/1" --config="/path/to/1/config.toml" --port=1377
 }

… with different ports to keep the sites out of each other’s hair. Then I have some functions for generating and pushing to production, like:

 function hugodeploy-1 {
    cd /path/to/1
    rm -rf /tmp/mysite.com
    chmod -R 755 /path/to/1/static/
    echo "GENERATING..."
    hugo --config="/path/to/1/config.toml" --baseURL="http://mysite.com" -s /path/to/1/ -d /tmp/mysite.com
    echo "SYNCING..."
    /path/to/rsync -avz --delete --iconv=UTF-8-MAC,UTF-8 --exclude '.well-known' /tmp/mysite.com/ myuser@remote-web-host.com:/home/myuser/path/to/1
 }

No idea what you need to do for google cloud storage, but, if you’re still having problems with the files generating for the local server but not being correctly generated in public for an upload somewhere, try being super specific with the args in the hugo command, extracting some ideas from the above.

@alexandros thanks for your answer. As I am new to website developement I don’t know if I pre-render the links or not. What I have is something like:

<a href="https://www.amazon.com/Art-Computer-Programming-Seminumerical-Algorithms/dp/0201896842/ref=as_li_ss_il?s=books&ie=UTF8&qid=1495602200&sr=1-2&keywords=The+Art%09of%09Computer%09Programming,%09Volume%092&linkCode=li2&tag=minutify04-20&linkId=45fd9ecc02af2725917ef70d899d6681" target="_blank"><img border="0" src="//ws-na.amazon-adsystem.com/widgets/q?_encoding=UTF8&ASIN=0201896842&Format=_SL160_&ID=AsinImage&MarketPlace=US&ServiceVersion=20070822&WS=1&tag=minutify04-20" ></a><img src="https://ir-na.amazon-adsystem.com/e/ir?t=minutify04-20&l=li2&o=1&a=0201896842" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />

which is a link from Amazon associates. What are other options other than pre-render? Can I render when the specific modal (overlay) is chosen>

@RickCogley thank you so much for the very informative answer. I found out that the content is actually generated but not in the way I thought. As Dimension is a single page theme with Modals (overlay) as pages, when I run hugo to build public folder, it puts all the .md files data in one index.html. For themes that are multi-page theme for every .md file there will be a corresponding index.html, so if I had 10 .md file I would have 10 index.html. But for Dimension theme if I have 10 .md file I get only one index.html. And that is the one that also has the content of the main website. As all data is now in just one file, I think it is the reason the site is so slow.

@alexandros is asking if I prerender links, which I don’t know. I have a lot of links similar to the above link. Are they pre-rendered?

1 Like

You need to check the <head> section of your template, to see if the links are pre-rendered.
Read this for more info: https://css-tricks.com/prefetching-preloading-prebrowsing/

If that isn’t your case then there is a script somewhere in your code that makes these requests.

This forum is for Hugo. A better place to ask for general web design issues is http://stackoverflow.com/

Also search Google you might find a solution to your problem. Maybe this is related to Amazon affiliate links. I’ve never used these and I don’t know anything about them.

EDIT
Just saw your site. There is no pre-rendering.

But why do you load jQuery in your body right after your <head> section? That may very well be the culprit.

You should move jQuery towards the bottom of your body above skel.js. Also a better way to increase the loading speed would be for you to defer your JS until after your page has loaded. See here for a simple way: https://varvy.com/pagespeed/defer-loading-javascript.html

But it seems that your site is a single page app that relies heavily in JS, so you have to see which scripts you can defer and which you cannot.

And that is the problem with single page websites. You can’t load everything in one go. You need to think of ways to load portions of what you need on demand. Also consider hosting those book cover images yourself to avoid the external HTTP requests to Amazon’s servers.