Mediumish-go-hugo theme yelds empty home page

Hi @jmooring, and first of all thanks for your help!

Second, allow me a general side note: me, I did not mess with the config.toml file, nor did I modify any template. When I first downloaded that theme, years ago, I simply assigned the values I needed to the several variables, wherever they were in the sample file, copying and pasting the extra language sections as and where they were in the original config file.

Also, I did not modify any template. In other words, what’s quite messy is the template as is at themes.gohugo.io., and IMVHO themes so messy shouldn’t be listed there, ever.

This said…

about _index.md:

If I run “hugo new content _index.md” all I get is the “Failed to resolve “content” to a archetype template” error that I only found mentioned here, but without solution.

so I created a content/_index.md file like this manually:

---
title: "Welcome"
draft: false
---

but see that having it or not, and with or without the “home page” code you suggest to add, makes no difference for what follows.

About the index.html template: here, I am really confused and sorry, because I realized that something weird happened on the old server, but don’t know exactly what/when/why.

The actual file layouts/_default/index.html that works fine on the old server/hugo version I must dismiss, and paginates properly at 6 POSTS (not pages) per page is the one pasted below. With the current version of Hugo, instead:

  • if I replace the pagination code of that templated with the one you suggested I get an “extra {{end}} error”

  • with or without a _index.md file, the current version of Hugo + the mediumish theme do paginate what I need… but in the wrong place. That is, they produce (see screenshot):

    • a home page that only lists PAGES (that is the .md files inside the “content” folder), not the actual posts that are in the “content/post” subfolder!
    • but the first entry in that page (“Posts”) is a link to “posts/index.html” which does lists/paginates the actual posts. In other words, what should be in /index.html, /page/2/index.html etc… is instead in /post/index.html, /post/page/2/index.html and so on.

What now? Thanks!!

The screenshot:

The index.html template:

{{ define "header"}}
    {{- partial "_shared/navbar.html" . -}}
{{ end }}

{{ define "main" }}
    {{- partial "_shared/title.html" . -}}
    <div class="main-content">
        <!-- Posts Index
        ================================================== -->
        <section class="recent-posts">
            <div class="section-title">
                <h2><span>All Posts</span></h2>
            </div>
            <div class="row listrecent">
                {{ $post_paginator := .Paginate (.Pages) 6 }}
                {{ range $post_paginator.Pages }}
                    {{- partial "list-partials/postbox.html" . -}}
                {{end}}
            </div>
        </section>
        {{- partial "list-partials/pagination.html" $post_paginator -}}
    </div>
    {{- partial "_shared/alertbar.html" . -}}
{{ end }}

{{ define "footer"}}
    {{- partial "_shared/jumbotron.html" . -}}
    {{- partial "_shared/footer.html" . -}}
{{ end }}