Hugo minimal HTML

hugo new theme testing surprisingly doesn’t generate HTML boiler plate.

Am I supposed to get it from https://gohugo.io/templates/base/ ?

I’m in the odd situation where https://www.netlifycms.org/docs/hugo/#creating-a-list-of-posts isn’t working locally on me with 0.68.3-1.

So I am very confused.

hugo new theme yourtheme only generates a skeleton of a theme: https://gohugo.io/commands/hugo_new_theme/

I don’t know when Netlify published that article, but there have been changes to how .Pages works in recent versions of Hugo. You probably want .Site.RegularPages.

If that is not enough to fix your issue, please read Requesting Help to see what information we need to be able to help.

With hugo new theme you get mosty empty theme files, you have to fill it!
Better check the theme gallery and clone the most fitting theme.

I think Site.RegularPages helps but still my blog doesn’t get built in 0.68.3-1

I find the theme gallery such a lottery. I just want to find a minimal upstream supported theme. :sweat_smile:

I am able to build (at least the homepage). You are missing at least a _default/list.html and _default/single.html layout files, so Hugo has no way of knowing how to build the rest of your pages.

1 Like

Ah, yes I was missing layouts/blog/single.html from the bottom of https://www.netlifycms.org/docs/hugo/ instructional.

I’m still amazed there isn’t a project with the minimum files.

Most of the ones I’ve randomly tried here: https://themes.gohugo.io/ Are just far far too complex.

Well, “minimum” is subjective.

I suggest not just randomly trying themes; instead use the tags. Looking at the themes tagged starter for example and I see a Blank theme, as well as a couple other minimal-looking themes.

If by minimum, you mean the least amount of files, just the two _default files I mention above will get Hugo to generate your site.

1 Like

hugo new theme generates EMPTY single.html and EMPTY list.html :frowning:

hugo new theme never generates any pages with {{ .Content }} so no content ever gets rendered in a new theme. I’ve wasted time on that too.

This doesn’t show test at http://localhost:1313/?

hugo new site testsite
cd testsite
hugo new theme themetest
echo 'theme = "themetest"' >> config.toml
echo '{{ .Content }}' > themes/themetest/layouts/index.html
echo test > content/_index.md
hugo serve
1 Like

test does show, but it kindof falls short of a “hello world” for a Website. I’d expect at the minimum:

  • HTML
  • Concept of posts
  • RSS feed

I wish I could filter out all the crazy (webpack) JS/sCSS pipelines from https://themes.gohugo.io/tags/starter/ and also see the latest ones in light of the scary breaking " Site.RegularPages" change.

Have you read the quickstart? There’s your “Hello World” example.

posts is subjective. Why must Hugo assume posts and not pages, articles, news, blog, etc? Why assume English at all?

Hugo comes with a RSS template embedded.

There was a big purge of themes re: .Site.RegularPages.


Going back to your original post:

If the question is why Netlify’s docs don’t work for the current Hugo version, it is best you ask them to update their docs.

If the question is why hugo new theme generates blank files: it is meant to generate a skeleton of a theme. What you put in there is up to you.

If you have questions outside of those, I would suggest you open a new topic with your specific question.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.