Pages not rendering

Hi,

I used hugo for my personal page and everything worked. After some time I tried to create a new post. But everything else then the index page gets not rendered.

The steps to reproduce:

clone https://github.com/sascha-andres/livingit.de
git submodule update --init # to get the theme
hugo server

I expect to be able to call /cv/, but it displays a 404 and with hugo the CV is not rendered. Any idea?

Please see https://github.com/gohugoio/hugo/issues/4539 for new findings

Kind regards,
Sascha

Check hugo --verbose output. The latest hugo also has a debug but verbose should be enough to see what is happening. Delete the public folder before running hugo, and update your message with the verbose output

The output of hugo --verbose is:

Building sites … INFO 2018/03/27 07:29:00 syncing static files to /home/andres/Documents/privat/web/_livingit.de/public/
INFO 2018/03/27 07:29:00 found taxonomies: map[string]string{"tag":"tags", "category":"categories"}
INFO 2018/03/27 07:29:00 Alias "/tags/page/1/index.html" translated to "tags/page/1/index.html"
INFO 2018/03/27 07:29:00 Alias "/categories/page/1/index.html" translated to "categories/page/1/index.html"

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

Total in 13 ms

The tree in the newly created public is:

β”œβ”€β”€ 404.html
β”œβ”€β”€ categories
β”‚   β”œβ”€β”€ index.html
β”‚   β”œβ”€β”€ index.xml
β”‚   └── page
β”‚       └── 1
β”‚           └── index.html
β”œβ”€β”€ css
β”‚   └── main.css
β”œβ”€β”€ img
β”‚   └── k8s-intro-001-synced-state.png
β”œβ”€β”€ index.html
β”œβ”€β”€ index.xml
β”œβ”€β”€ sitemap.xml
└── tags
    β”œβ”€β”€ index.html
    β”œβ”€β”€ index.xml
    └── page
        └── 1
            └── index.html

8 directories, 12 files

while the one in content is

β”œβ”€β”€ cv
β”‚   └── index.md
└── index.md

If I use hugo version 0.31.1, the output looks like this:

INFO 2018/03/27 07:33:35 syncing static files to /home/andres/Documents/privat/web/_livingit.de/public/
Started building sites ...
INFO 2018/03/27 07:33:35 found taxonomies: map[string]string{"tag":"tags", "category":"categories"}
INFO 2018/03/27 07:33:35 Alias "/categories/page/1/index.html" translated to "categories/page/1/index.html"
INFO 2018/03/27 07:33:35 Alias "/cv/page/1/index.html" translated to "cv/page/1/index.html"
INFO 2018/03/27 07:33:35 Alias "/tags/page/1/index.html" translated to "tags/page/1/index.html"

Built site for language en:
0 draft content
0 future content
0 expired content
2 regular pages created
8 other pages created
0 non-page files copied
1 paginator pages created
0 tags created
0 categories created
total in 11 ms

and the output is as expected

I have the same issue (and already commented on the GitHub issue)

Here is also the verbose output of my example site:

INFO 2018/03/27 09:49:13 Using config file: C:\Users\Die Hubers\Desktop\test\config.toml
e[?25lBuilding sites … INFO 2018/03/27 09:49:13 syncing static files to C:\Users\Die Hubers\Desktop\test\public\
WARN 2018/03/27 09:49:13 No translation bundle found for default language "en"
WARN 2018/03/27 09:49:13 Translation func for language en not found, use default.
WARN 2018/03/27 09:49:13 i18n not initialized, check that you have language file (in i18n) that matches the site language or the default language.
INFO 2018/03/27 09:49:13 found taxonomies: map[string]string{"tag":"tags", "category":"categories"}
e[K25h
                   | EN
+------------------+----+
  Pages            |  8
  Paginator pages  |  0
  Non-page files   |  0
  Static files     | 12
  Processed images |  0
  Aliases          |  0
  Sitemaps         |  1
  Cleaned          |  0

Total in 52 ms

How to reproduce my problem: Run hugo server (>=0.32) and visit it in a browser. The home page works just fine, the page labled X shows a 404. At least this is the case for me.

In server mode, I can fix the issue by renaming the file x/index.md to x/index1.md and back. After a reload in the browser the page shows up. Of course, the problem can’t be fixed like that in β€œnormal” static output mode.

The missing page is also not included in the generated sitemap.

In hugo version 0.30 and 0.31 everything works fine. Maybe it’s dependant on the theme (hugo-material-docs), but there are no error messages shown in the console.

It might be related to:

1 Like

You are essentially creating a leaf bundle at root level, so the cv dir and the content inside can be accessed only as page resources. See the documentation on Page Resources in the Hugo docs to understand that concept.

But in this case, you are unintentionally creating those page resources. So the fix might as simple as renaming the outer index.md to _index.md i.e. making that a branch bundle.

Confirmed, in my test case it works as expected after renaming the root index.md to _index.md.

But there is still one issue remaining: Even with the root file as index.md (without underscore), there is a case when the subpage is rendered when running hugo server. This happens when you rename the file in the subfolder to a random name (e.g. index1.md) and back to it’s original filename (index.md).

Hi,

moving cv/index.md to content/cv.md resolved this. Thanks for your suggestions. Upgrading from pre 0.32 to current is not straightforward.

Kind regards,
Sascha