Index.html not displayed in 0.20

After upgrading to 0.20 I have problems with some block based sites. The problem might be related with the problem reported here: https://discuss.gohugo.io/t/blocks-stopped-working-for-section-layout/6105/5

In one site the index.html from the theme is not displayed, but I could not fix it by copying the baseof.html to the project layput folder.

In other sites section lists are not displayed.

OK, I have obviously broken something related to blocks and sections; I will look into it and create a bug fix relase in the near future.

I just saw that this is not related to 0.20

I have put a customized list.html into the projects layout/_default folder which not only overrides the list.html in the theme layout/_default folder but also the baseof.html in the themes layout/_default folder.

I am not sure whether this is a bug too.

I reverted the commit and now 0.20 works with this site.

I have similar problems w/ 0.20 — w/o anything fancy.

Flying today, but will try minmal reproduce.

Short story:

  • Hugo site w/ hugo-universal-theme
  • Example theme works fine w/ 0.20;
  • my-site w/ theme - no index (or more to the point, nothing after the top carousel - enabled)

So far, only things are carousel, and changed image files w/in my site directory;

The carousel HTML is generated, but doesn’t display, because nothing (include js) after the carousel block has been generated…

…more, later…

@yarko When you land, point me to a repo and I’ll see what I can do. Safe travels!

Ok @rdwatters - this looks simpler than I thought:

example:

$ hugo new site testsite
$ cd testsite/
$ git init .
$ git submodule add git@github.com:devcows/hugo-universal-theme.git themes/hugo-universal-theme
$ cp themes/hugo-universal-theme/exampleSite/config.toml .
$ hugo serve

It looks like carousel configuration, or any additional changes aren’t needed to show this effect. You can edit the config.toml to set params.carousel: enable = false and it seems to make no difference.

Nothing is generated in the body portion of the html after the header.

This wasn’t so in 0.19.0 or to some point in 0.20.dev. Today, I test this w/ v0.20.1:

$ hugo version
Hugo Static Site Generator v0.20.1-8AC1FCD linux/amd64 BuildDate: 2017-04-14T22:10:40-05:00
$ go version
go version go1.8.1 linux/amd64

A simple sanity check:

$ cd themes/hugo-universal-theme/exampleSite
$ ln -s ../.. themes
$ hugo serve   # all rendered fully, as expected;

Is this enough to reproduce?

This may be related:

https://github.com/spf13/hugoThemes/issues/241

And, while it may be a breaking change from 0.19, it isn’t something we’re changing – I’m not going back to any hardcoded “if index.html” constructions.

1 Like

@bep Is this change documented somewhere already? I just encountered the same issue because I am using the content/xxxxx/index.md structure for all my pages, e.g. content/about/index.md.

What would be the prefered way to create single-pages in Hugo v0.20+? Beside the moving of layouts and content pages mentioned in the GitHub Issue I found that creating a about.md inside content creates the expected about page under mydomain.tld/about/.

Edit: I just realized my category & tag overview pages are rendering empty, too, e.g. mydomain.tld/categories/ is empty but mydomain.tld/categories/cat-1 shows fine. This was working in v0.19. I’ll see if I can find out why it is not working now.

So, content/about/index.md will, without any slug or ugly URLs or similar end up in /about/index/index.html. The “it worked in Hugo 0.19” is, as I said, just accidental, and we’re not going there.

If you want some other URL, there are plenty of options. What the “preferred way” is, is individual. If you want to know my preferred way, have a look at my blog: GitHub - bep/bepsays.com: Source code and content for bepsays.com Works great!

4 Likes

I see! I didn’t connect this behaviour to the new Output Formats. I’ll read up and update my site accordingly. Thanks for your reply and thanks A LOT for all your work on Hugo!

Note that this side-effect wasn’t intentional, as in: I did not think about it, but it is really hard to imagine all the variations in the wild. But the old behaviour was ambiguous and impossible to handle in a general way.

[Edit:] @rdwaters - @bep’s post made me try this again, with the hugo-creative-portfolio theme.

I needed to copy the content and data folders out of exampleSite. It then seems to generate all the pages, etc. in either hugo v0.19 or v0.20.1

I’m now going back to the hugo-universal-site to see which elements from the example site are needed in my site - my concern is now about the silent failure of generation of elements of the static output (would I prefer to discover missing elements in the static tree, or missing elements which refer to them?). My answer is I would prefer to get notifications during generation - that would be consistent with “fast” generation during development of content.

Note: in reading @bep’s comments, I (new to hugo) think there is an aspect of ramp-up for me, getting caught in this behavioral change between v0.19 and v0.20 in the process…

I built a separate hugo v0.20.1 (installed as hugo20), and repeated my simple experiment with git@github.com:kishaningithub/hugo-creative-portfolio-theme.git as the cloned theme.

I’m running (as in the previous example) with go 1.8.1, and hugo v0.19 and v0.20.1 on Ubuntu 16.04.