Hugo rendering issue - Theme, Forty

This is an annoying issue I have been trying to deal with for over a week. I have made some custom changes to the theme using page bundle instructions to have list page links inside another link page like;

Main Page
Link to the Fruits page
-Fruits (list page)
–Red Fruits (list page)
—Apple
—Strawberry
–Yellow Fruits (list page)
—Banana
—Melon

Ever since I am having trouble with Hugo rendering the pages. Whenever I start to work on my site to develop it and refresh the page (offline) to see the change i made, hugo is having trouble rendering the list pages correctly. If it renders “Red Fruits” page correctly, it will render “Yellow Fruits” page incorrectly. And sometimes it renders both correctly. This happens no matter in which section of the template I am working on.

Incorrect (No items on the list)
wrong
Correct (items can be seen on the list)
right

Link to my hugo raw files

There is no Hugo site in the repo you linked to.

To have a better idea of what is the nature of the problem we need to have a look at your project’s source.

Sorry, internet problem. Uploaded

I saw your repo and I suppose you are referring to your /plant_protection/section that has this sample structure:

plant_protection
          └── _index.md
          └── fungicide.md
          └── fungicide
               └── _index.md
               └── several markdown content pages

Your content under this section renders on my end but there is some URL ambiguity.

For example your section contains a fungicide.md that resolves to /plant_protection/fungicide/

And a /fungicide/ nested section that resolved to the same URL as above.

See the documentation on Page Bundles and Nested Sections.

It’s up to you how you want organize your content and whether /fungicide/ should be a Nested Section that uses an _index.md or a Page Bundle that should use an index.md

In any case you should remove the duplicate .md files that have the same name as the same sub-directories under your section.

Nested as;

└── _index.md
      └── fungicide.md (removed)
      └── fungicide
           └── _index.md (renamed as  index.md)
           └── several markdown content pages

Now I see a blank page when I click on the link of ‘fungicide’

The content of the index.md is

title: “fungicide”
layout: “list”
slug: “fungicide”
image: pic02.jpg
date: 2017-10-31T22:27:21-05:00
draft: false

:thinking:

index.md = Leaf Bundle (single page) - default template /layouts/_default/single.html
_index.md = Branch Bundle (list page) - default template /layouts/_default/list.html

But since you have specified layout: “list” in the front matter of your index.md make sure that the respective template single.html template exists under your layouts/list/ folder or remove that front matter parameter and use the default single page template.

See Template lookup order | Hugo

└── Plant Protection
      └── fungicide
           └── Item 1
           └── Item 2
      └── insecticide
           └── Item 1
           └── Item 2 
    └── Plant Nutrition
      └── fertilizers
           └── Item 1
           └── Item 2

This is the page hierarchy that i am trying to accomplish. Therefore, I guess my /plant_protection directory and plant_protection/fungicide directory must be a list page in order to list the items within those directories.
So to say, I will need _index.md in those directories to make them list pages, am I right?

Yes. If you want the items within those directories to have their own permalinks you should turn them into Nested Sections.

Sorry for the headache

Second

When I put an _index.md into plant_protection/fungicide with the frontmatter below, I cannot see the link on the plant_protection directory (or page) to go to plant_protection/fungucide directory (or page)

---
title: "fungicide"
layout: ""
slug: "fungicide"
image: pic03.jpg
date: 2017-10-31T22:27:21-05:00
draft: false
---
fungusit

Note: I see the fungucide page alright when I reach to it by using typing the address into the address bar of the browser. So the question is that how can i put a link on plant_protection directory (or page) to reach to the fungicide page? That is the reason I used fungicide.md files on the upper directory ( plant_protection ). But it sometimes rendered correctly and sometimes not.

Eliminate completely the above.

Because there was ambiguity in your URLs so the rendering was a bit like winning the lottery.

Gave up on this theme. Thanks for the time