Content not displaying

Hi, so I’m new to Hugo and still getting my ropes in understand how Hugo works.

I managed to install this theme http://themes.gohugo.io/type/

but somehow my content is not appearing

I clicked on About and the result is the same, just empty.

I even copied config.toml, content, post, data and static into my site below but there’s still no content.

I opened up one of the markdown files to see if there’s any problem with it but it renders perfectly fine in VSCode MD Preview

So I’m not sure why it’s not showing the content.

Thanks

Omar Tan

I manage to make the index.html to render properly, turns out I needed to replace my layouts folder which is weird as it wasn’t instructed that I needed to replace my layouts folder or do I get Hugo set up wrong? The first theme I installed was the Strata theme and it has a slightly different way of doing things then Type. I followed this guide btw

However, my about page is still not rendered

Okay, so it seems it has something to do with index.md as when I create a new file called about.md and copy paste the content from index.md, the page renders correctly. Any idea why does it work this way? Cause the tutorials certainly didn’t say so.

Hi, Omar, and welcome to the forums.

You’ve posted a lot of information, but it’s not clear what steps you actually took and what the issue is. Are you trying to set up a site on Netlify and having problems? Is it not working on your local computer? Which version of Hugo are you using? How did you create your site? Is it possible for you to put a copy of your site up on GitHub and post a link to it?

Thanks,
Mike

Hi,

So I managed to fix my issues but without some problems and I’ll explain what steps I did.

  1. I followed this tutorial to set up my site initially, and it worked as intended https://www.netlify.com/blog/2016/09/21/a-step-by-step-guide-hugo-on-netlify/

  2. I decided that the theme used wasn’t appropriate for what I wanted to do, so I ended up choosing this theme to replace it http://themes.gohugo.io/type/

  3. I followed the instructions given

In order to get your site running, you need to copy config.toml and data/l10n.toml into the root folders.

  1. But turns out my page ended up with the content not appearing (CSS and HTML seem to render fine). I tried copying the data folder since by default, the theme already has some content in it, as my logic was, if I were to copy and replaced my current data folder, it’ll surely show something.

  2. After doing that, no change, content still not appearing

  3. I found out that my current Layouts folder is very different from the one given in Type Theme, so I decided to replace my current Layout folder to the one given by Type Theme and the theme finally renders as expected (with content), however upon clicking my about page (about/index.md), it still has no content.

  4. I managed to solve my about page issue by creating a new file in the same directory (about/about.md) and now the site worked as intended, with all contents and about page displayed correctly.


So those are the steps that I did, what I don’t understand was, why didn’t the theme worked as the instructions given? Since I had to do many workarounds and I still don’t understand why index.md won’t render the content but creating a new file with the same content and naming it differently will render the content?.

I come from Wordpress background, so replacing theme in Hugo has been a real surprise to me.

And I’m running on Hugo 0.18

Hello @o.tan,

I’m the maintainer of the type theme. The instructions given in the README in combination with the exampleSite folder show the example posts on the homepage as expected.

With the given information, especially about the layout directory, it’s not possibe to determine why the templates aren’t rendered. Did you left templates from prior themes in this folder which might created a naming conflict? Nonetheless, it seems that fixed this issue on your own.

So those are the steps that I did, what I don’t understand was, why didn’t the theme worked as the instructions given? Since I had to do many workarounds and I still don’t understand why index.md won’t render the content but creating a new file with the same content and naming it differently will render the content?.

Hugo 0.18’s new thing is that now everything is a page. In prior versions index.md rendered as expected to index.html. Since about is also a section (like posts) it could contain multiple content files that usually would be listed at about/index.html.

The order of the template rendering in recent versions of Hugo made it possible that the content list of the about section was overwritten by about.md. The current version doesn’t guaranty this processing order.

For more information follow this thread.

The easiest option would to rename about/index.md (like you did) and to add url = "/about/" to the frontmatter. This should force Hugo to render the page under the given url.

1 Like