Render as single

I’m new to hugo
i try to use i as an cms and not as an blog engine.
everything works fine, but i want to have an
that renders “/” as single page and not as list of posts

i’m using

this must be simple, but i find nothing about it

btw the
hugo new --kind “$randomstring” seems to does nothing, is this a bug?

1 Like

/ is a list template.

With the current version of Hugo, everything is a page. So, you can do this with your source organization:


Note Use and not This will be the content and front matter for your homepage now. Once you have content added to this page, you can call it in the layouts/index.html template the same way you would any other individual content file via {{.Content}}. If you have errors with this approach, I would recommend filing an issue on the theme’s github repository. It looks like it hasn’t been updated in a while…since it requires only v14 of the HUGO to run.


The easiest thing to try is:

Remove this section from the Homepage template

              {{ range .Data.Pages }}
          <div class="post">
            <h1 class="post-title">
              <a href="{{ .Permalink }}">
                {{ .Title }}
            <span class="post-date">{{ .Date.Format "Mon, Jan 2, 2006" }}</span>
            {{ .Content }}
          {{ end }}

Then create an file in the /content/ folder: /content/ with your content.


  <div class="post">
    {{ .Content }}

instead of the removed part of the template and everything should be fine.

1 Like
does not work, can you give me a full example please?

i dont want to touch anything in themes/
(cant be right, hugo should be a cms, not blog only)

there are 2 templates in “hyde”:

ls -1 themes/hyde/layouts/_default/

is there no way to force the use of “single” via header?

hugo new --kind doing nothing is a bug?
i cant find “_$” in the docs

is there a chat group?
i’m willing to help and improve the docs as well

The home page has a separate template, index.html in the theme folder.
single.html and list.html are used for rendering the content of the subfolders of your content directory.

The way index.html is set up in this theme is to give a list of posts ({{ range .Data.Pages }}) so it does not read your at all as it looks through all your other content pages and puts this in the homepage.

So I would try to change the index.html template file (/themes/hyde/layouts/index.html) to:

{{ partial "head.html" . }}
<body class="{{ .Site.Params.themeColor }} {{if .Site.Params.layoutReverse}}layout-reverse{{end}}">

{{ partial "sidebar.html" . }}

    <div class="content container">
<div class="posts">

  <div class="post">
    <h1 class="post-title">
        {{ .Title }}

    {{ .Content }}
  {{ end }}


and this should show up the Title and Content of your Frontmatter in /content/

so this is just the wrong theme for what i want to do
and there is no workaround without touching anything inside the theme folder

i’ll read more docs&source
i’m not happy with this :slightly_smiling:

Yes, supplied themes are just for “standard use”.
I started to use Hugo for a “blog section” of my home page, but recently I set up a theme for the complete website with a set of “normal pages” as well as a blog section on top.
So as I read through the docs and this forum and get things working slowly I try to write a german language tutorial in the blog section. Maybe this may help others - but it helps me structuring the information and understand hugo … :slightly_smiling:

The first comment is semi-correct and the second comment is incorrect.

To piggyback on what @ominty just said, you should create your own index.html file, but do it in your root project directly and not in the theme directory. The lookup order will privilege your index.html template over the theme’s index.html template. This is by design and for very good reason: you are able to override the theme templating while still keeping compatibility with the upstream of the theme.

So, instead of making the recommended layout at /themes/hyde/layouts/index.html, just make it at /layouts/index.html.

If you are not finding that you can access {{.Content}} while running hugo, the first thing is to make sure you are running the latest version via hugo version.



Thank you!

vim content/
cp themes/hyde/layouts/_default/single.html layouts/index.html

any way to include that and not copy it, or not use a symlink?

Thank you!

[quote=“rdwatters, post:8, topic:5533”]
you should create your own index.html file, but do it in your root project directly and not in the theme directory. The lookup order will privilege your index.html template over the theme’s index.html template.
[/quote]explicit consent
… and sorry for not thinking about that. That’s because I try to set up my own theme from scratch and so I’m working in the /themes directory all the time …

Ah! Thank you so much @ominty . I am new to Hugo as well and I was having the exact same problem with the theme hyde-hyde (which is derived from hyde).

I spent hours and hours searching until I found your post :slight_smile:.

This worked beautifully.

Note: as pointed out by @rdwatters, I did not edit the theme, but created my copy (following advice I had found here before finding this forum).