# Minimal site with section listings

**URL:** <https://discourse.gohugo.io/t/minimal-site-with-section-listings/29832>\
**Category:** support\
**Created:** [December 6, 2020, 11:50am UTC](https://discourse.gohugo.io/t/minimal-site-with-section-listings/29832 "2020-12-06T11:50:21Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![hendry](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/hendry/32/7037_2.png) [@hendry](https://discourse.gohugo.io/u/hendry)\
**Post date:** [December 6, 2020, 11:50am UTC](https://discourse.gohugo.io/t/minimal-site-with-section-listings/29832/1 "2020-12-06T11:50:21Z")

</div>

Good Sunday evening!

I created a [minimal site](https://dabase.com/e/04066/) with:

```
tree content/tips/
content/tips/
├── bar
│ └── test2.md
├── foo
│ └── test1.md
└── _index.md

```

But public/tips/index.html is not rendering et al. What am I missing?

```
(ins)[hendry@t14s testing]$ hugo --disableKinds=taxonomy,taxonomyTerm,RSS,sitemap
Start building sites …

                   | EN
-------------------+-----
  Pages | 5
  Paginator pages | 0
  Non-page files | 0
  Static files | 0
  Processed images | 0
  Aliases | 0
  Sitemaps | 0
  Cleaned | 0

Total in 22 ms
(ins)[hendry@t14s testing]$ find public/
public/
public/index.html

```

[https://s.natalian.org/2020-12-06/tips-listing-missing.zip](https://s.natalian.org/2020-12-06/tips-listing-missing.zip)

Thank you in advance, I’m on Arch with v0.79.0/extended btw

My end goal is to have a listing like [https://til.simonwillison.net/](https://til.simonwillison.net/)

---

<div class="post-metadata">

**Author:** ![davidsneighbour](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/davidsneighbour/32/24507_2.png) [@davidsneighbour](https://discourse.gohugo.io/u/davidsneighbour)\
**Post date:** [December 6, 2020, 12:26pm UTC](https://discourse.gohugo.io/t/minimal-site-with-section-listings/29832/2 "2020-12-06T12:26:02Z")

</div>

What’s in \_index.md? Anything looking like it’s a draft or created by a layout that does not exist?

---

<div class="post-metadata">

**Author:** ![hendry](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/hendry/32/7037_2.png) [@hendry](https://discourse.gohugo.io/u/hendry)\
**Post date:** [December 6, 2020, 12:53pm UTC](https://discourse.gohugo.io/t/minimal-site-with-section-listings/29832/3 "2020-12-06T12:53:45Z")

</div>

```
(ins)[hendry@t14s a]$ curl -sO https://s.natalian.org/2020-12-06/tips-listing-missing.zip
(ins)[hendry@t14s a]$ unzip -p tips-listing-missing.zip content/tips/_index.md
---
Title: Tips
---

```

Isn’t that sufficient?

---

<div class="post-metadata">

**Author:** ![davidsneighbour](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/davidsneighbour/32/24507_2.png) [@davidsneighbour](https://discourse.gohugo.io/u/davidsneighbour)\
**Post date:** [December 6, 2020, 1:08pm UTC](https://discourse.gohugo.io/t/minimal-site-with-section-listings/29832/4 "2020-12-06T13:08:46Z")

</div>

```auto
patrick@bookra:/dev/pts/1>~/Projects/dnb-hugo
[09:24:39][patrick@bookra] ~/Projects/dnb-hugo (+1|%0|!16877|0)
❯ curl -sO https://s.natalian.org/2020-12-06/tips-listing-missing.zip
patrick@bookra:/dev/pts/1>~/Projects/dnb-hugo
[20:03:11][patrick@bookra] ~/Projects/dnb-hugo (+1|%0|!16878|0)
❯ unzip tips-listing-missing.zip 
Archive: tips-listing-missing.zip
  inflating: Makefile                
   creating: public/
  inflating: public/index.html       
   creating: resources/
   creating: resources/_gen/
   creating: resources/_gen/assets/
   creating: resources/_gen/images/
  inflating: config.toml             
   creating: themes/
   creating: data/
   creating: static/
   creating: archetypes/
  inflating: archetypes/default.md   
   creating: content/
   creating: content/tips/
 extracting: content/tips/_index.md  
   creating: content/tips/bar/
  inflating: content/tips/bar/test2.md  
   creating: content/tips/foo/
  inflating: content/tips/foo/test1.md  
  inflating: content/index.md        
   creating: layouts/
   creating: layouts/_default/
  inflating: layouts/_default/list.html  
 extracting: layouts/_default/single.html  
patrick@bookra:/dev/pts/1>~/Projects/dnb-hugo
[20:03:18][patrick@bookra] ~/Projects/dnb-hugo (+1|%0|!16879|0)
❯ hugo
Start building sites … 

                   | EN  
-------------------+-----
  Pages | 10  
  Paginator pages | 0  
  Non-page files | 0  
  Static files | 0  
  Processed images | 0  
  Aliases | 0  
  Sitemaps | 1  
  Cleaned | 0  

Total in 144 ms
patrick@bookra:/dev/pts/1>~/Projects/dnb-hugo
[20:03:22][patrick@bookra] ~/Projects/dnb-hugo (+1|%0|!16849|0)
❯ ls -al public/
total 28
drwxr-xr-x 4 patrick patrick 4096 Dec 6 20:03 .
drwxrwxr-x 28 patrick patrick 4096 Dec 6 20:03 ..
drwxrwxr-x 2 patrick patrick 4096 Dec 6 20:03 categories
-rw-rw-r-- 1 patrick patrick 98 Dec 6 20:03 index.html
-rw-rw-r-- 1 patrick patrick 707 Dec 6 20:03 index.xml
-rw-rw-r-- 1 patrick patrick 438 Dec 6 20:03 sitemap.xml
drwxrwxr-x 2 patrick patrick 4096 Dec 6 20:03 tags
patrick@bookra:/dev/pts/1>~/Projects/dnb-hugo
[20:03:45][patrick@bookra] ~/Projects/dnb-hugo (+1|%0|!16850|0)
❯ 

```

I can do CLI too 🙂

It creates categories and tag pages, but not the tips section and not the posts in tips itself. So something else might be weirdly set up. Let’s wait until someone else has a look (pinging @jmooring who has eagle eyes for these kinds of things).

---

<div class="post-metadata">

**Author:** ![davidsneighbour](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/davidsneighbour/32/24507_2.png) [@davidsneighbour](https://discourse.gohugo.io/u/davidsneighbour)\
**Post date:** [December 6, 2020, 1:24pm UTC](https://discourse.gohugo.io/t/minimal-site-with-section-listings/29832/5 "2020-12-06T13:24:22Z")

</div>

Here is the issue:

YOU CAN’T HAVE A FOLDER WITH `index.md` and further inside of that folder a `_index.md`.

Having an index.md is always the last markdown part of your file structure. Only \_index.md files can have page-bundles further down the line.

content/index.md must be content/\_index.md

I am not in front of a computer right now, but can test in an hour. Try renaming it. Might solve it all.

---

<div class="post-metadata">

**Author:** ![hendry](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/hendry/32/7037_2.png) [@hendry](https://discourse.gohugo.io/u/hendry)\
**Post date:** [December 6, 2020, 1:52pm UTC](https://discourse.gohugo.io/t/minimal-site-with-section-listings/29832/6 "2020-12-06T13:52:23Z")

</div>

No difference!

```
(ins)[hendry@t14s testing]$ ls content/tips/index.md
content/tips/index.md
(ins)[hendry@t14s testing]$ hugo --disableKinds=taxonomy,taxonomyTerm,RSS,sitemap
Start building sites …

                   | EN
-------------------+-----
  Pages | 5
  Paginator pages | 0
  Non-page files | 0
  Static files | 0
  Processed images | 0
  Aliases | 0
  Sitemaps | 0
  Cleaned | 0

Total in 19 ms
(ins)[hendry@t14s testing]$ find public/
public/
public/index.html

```

I find it frustrating that hugo says its built 5 pages when there is only one in the public/ dir.

---

<div class="post-metadata">

**Author:** ![davidsneighbour](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/davidsneighbour/32/24507_2.png) [@davidsneighbour](https://discourse.gohugo.io/u/davidsneighbour)\
**Post date:** [December 7, 2020, 8:59am UTC](https://discourse.gohugo.io/t/minimal-site-with-section-listings/29832/7 "2020-12-07T08:59:12Z")

</div>

```auto
├── content
│ ├── _index.md
│ └── tips
│ ├── bar
│ │ └── test2.md
│ ├── foo
│ │ └── test1.md
│ └── _index.md

```

This works. If not, run `hugo` and not `hugo --lotsofparameters`

And it says 5 pages because overview pages (for instance for the tags) will also count. It did in both cases (wrong index.md file name and proper file name) tell me it created 10 pages. Weird indeed.

---

<div class="post-metadata">

**Author:** ![davidsneighbour](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/davidsneighbour/32/24507_2.png) [@davidsneighbour](https://discourse.gohugo.io/u/davidsneighbour)\
**Post date:** [December 7, 2020, 9:00am UTC](https://discourse.gohugo.io/t/minimal-site-with-section-listings/29832/8 "2020-12-07T09:00:33Z")

</div>

> **[Page Bundles](https://gohugo.io/content-management/page-bundles/)**
>
> Content organization using Page Bundles

Check the table in that page, especially the 4th row 🙂

---

<div class="post-metadata">

**Author:** ![hendry](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/hendry/32/7037_2.png) [@hendry](https://discourse.gohugo.io/u/hendry)\
**Post date:** [December 7, 2020, 9:37am UTC](https://discourse.gohugo.io/t/minimal-site-with-section-listings/29832/9 "2020-12-07T09:37:02Z")

</div>

Sorry, i don’t understand how to get my content/tips rendering out into public/

[https://s.natalian.org/2020-12-07/confuse.mp4](https://s.natalian.org/2020-12-07/confuse.mp4)

---

<div class="post-metadata">

**Author:** ![alexandros](https://avatars.discourse-cdn.com/v4/letter/a/ecc23a/32.png) [@alexandros](https://discourse.gohugo.io/u/alexandros)\
**Post date:** [December 7, 2020, 10:14am UTC](https://discourse.gohugo.io/t/minimal-site-with-section-listings/29832/10 "2020-12-07T10:14:06Z")

</div>

@hendry

A video reply! Now that’s a first in this forum.

However I humbly request that you refrain from posting external videos with recorded replies as these may be removed in the future and forum topics will end up being incoherent with part of the discussion missing.

Thanks.

P.S. I’ll have a look at that ZIP file and let you know once I see what’s going on.

---

<div class="post-metadata">

**Author:** ![alexandros](https://avatars.discourse-cdn.com/v4/letter/a/ecc23a/32.png) [@alexandros](https://discourse.gohugo.io/u/alexandros)\
**Post date:** [December 7, 2020, 10:37am UTC](https://discourse.gohugo.io/t/minimal-site-with-section-listings/29832/11 "2020-12-07T10:37:35Z")

</div>

In the above provided ZIP the `tree` under the `contentDir` is the following:

```auto
├── content
│ ├── index.md
│ └── tips
│ ├── bar
│ │ └── test2.md
│ ├── foo
│ │ └── test1.md
│ └── _index.md

```

With this setup the entire `contentDir` has been converted into a leaf bundle.

Basically `/tips/` and its children are now accessible as `.Resources.ByType "page"` i.e. they are Page Resources of the homepage i.e. `/content/index.md`.

To make `/tips/` a publishable Hugo section you need to rename:  
`/content/index.md` --\> `/content/_index.md`  
as @davidsneighbour already pointed out.

Also under the project’s layouts folder you currently have:

```auto
layouts
└── _default
    ├── list.html
    └── single.html

```

In these files you are using Base Templates yet you have not specified a `layouts/_default/baseof.html` hence your project’s pages render empty.

Please have a look at the relevant articles in the Hugo Documentation and provide the missing template so that your project’s pages are rendered.

---

<div class="post-metadata">

**Author:** ![hendry](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/hendry/32/7037_2.png) [@hendry](https://discourse.gohugo.io/u/hendry)\
**Post date:** [December 8, 2020, 3:42am UTC](https://discourse.gohugo.io/t/minimal-site-with-section-listings/29832/12 "2020-12-08T03:42:02Z")

</div>

Thank you! So IIUC, before I accidentally created a “leaf bundle” instead of a “branch bundle” and hence I got a bit stuck!

I’ve added a baseof.html and now upon tips/ I have a listing like:

- [Bar tips](http://localhost:1313/tips/bar/)
- [Foo tips](http://localhost:1313/tips/foo/)

And what I want instead is:

- [Bar tips](http://localhost:1313/tips/bar/)
  - [Test 2](http://localhost:1313/tips/bar/test2)

- [Foo tips](http://localhost:1313/tips/foo/)
  - [Test 1](http://localhost:1313/tips/foo/test1)

I’m guessing I need to modify

```
<ul>
{{ range .Pages }}
<li><a href="{{.RelPermalink}}">
{{ $alternate_title := replace .File.BaseFileName "_" " " | title }}
{{ .Title | default $alternate_title }}
</a></li>
{{ end }}
</ul>
{{ end }}

```

But I am not sure how. Wish [https://gohugo.io/content-management/sections/](https://gohugo.io/content-management/sections/) had an example.

---

<div class="post-metadata">

**Author:** ![system](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/system/32/1_2.png) [@system](https://discourse.gohugo.io/u/system)\
**Post date:** [December 10, 2020, 3:42am UTC](https://discourse.gohugo.io/t/minimal-site-with-section-listings/29832/13 "2020-12-10T03:42:03Z")

</div>

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