# Pages are not found after the upgrade

**URL:** <https://discourse.gohugo.io/t/pages-are-not-found-after-the-upgrade/50938>\
**Category:** support\
**Created:** [July 30, 2024, 10:57am UTC](https://discourse.gohugo.io/t/pages-are-not-found-after-the-upgrade/50938 "2024-07-30T10:57:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anton-efimov-unzer](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/anton-efimov-unzer/32/22607_2.png) [@anton-efimov-unzer](https://discourse.gohugo.io/u/anton-efimov-unzer)\
**Post date:** [July 30, 2024, 10:57am UTC](https://discourse.gohugo.io/t/pages-are-not-found-after-the-upgrade/50938/1 "2024-07-30T10:57:15Z")

</div>

I am having an issue with the the template after the hugo update.  
I have the following code:

```auto
...
{{ range first 5 .Data.Pages.ByWeight}} 
            {{if(eq "Home" .Page.Title )}}
                {{ range first 5 .Data.Pages.ByWeight}}     
                {{$partialPath := (print "widgets/" .Page.File.TranslationBaseName ".html" ) }} 
                {{ partial $partialPath .}} 
            {{end}} 
        {{end}} 
    {{ end }}
...

```

The code above finds a folder `content/new-home` with the following files in it:

- \_index.md
- name-a.md
- name-b.md
- name-c.md
- name-d.md

The file `_index.md` has the following code

```auto
---
Title: "Home"
weight: 1
---

```

All `name-[X].md` files have only frontmatter that looks something like that:

```auto
---
widget: blank
headless: true

# ... Put Your Section Options Here (title etc.) ...
title: ...
subtitle: ...
btnTitle: ...
btnLink: ...
imgUrl: ...
weight: 1 
---

```

Now, the problem here is that this works absolutely fine in the `0.122.0` version of hugo: it grabs all the `name-[X].md` files and looping through them sends them to the partials.  
It doesn’t work in versions `0.123.0` and above (frankly, I only checked in 123 and 129).  
I tried to debug it and I found that `{{ .Pages }}` under the first loop returns `Pages(0)` for the newer versions and `Pages(4)` for the `0.122.0`.

I looked at the release notes but couldn’t really figure out what should have been changed since the upgrade. Can you help me here?

---

<div class="post-metadata">

**Author:** ![irkode](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/irkode/32/26135_2.png) [@irkode](https://discourse.gohugo.io/u/irkode)\
**Post date:** [July 31, 2024, 4:26am UTC](https://discourse.gohugo.io/t/pages-are-not-found-after-the-upgrade/50938/2 "2024-07-31T04:26:25Z")

</div>

> [@anton-efimov-unzer](#):
>
> `.Data.Pages.ByWeight`

your code snippet uses `.Data.Pages.ByWeight` which leads to using taxonomies?

If I where you I would provide a minimal _runnable_ repo.

according to the _current_ docs: [Front matter | Hugo](https://gohugo.io/content-management/front-matter/#headless)

> headless: if `true` this value **sets the `render` and `list`** [build options](https://gohugo.io/content-management/build-options/) **to `never`** , creating a headless bundle of [page resources](https://gohugo.io/content-management/page-resources/).

with that it might not be possible to list the pages from where you are.

Check out the build options mentioned - there you can set different values for list and render. maybe better on the index and cascade that down.

---

<div class="post-metadata">

**Author:** ![anton-efimov-unzer](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/anton-efimov-unzer/32/22607_2.png) [@anton-efimov-unzer](https://discourse.gohugo.io/u/anton-efimov-unzer)\
**Post date:** [July 31, 2024, 10:49am UTC](https://discourse.gohugo.io/t/pages-are-not-found-after-the-upgrade/50938/3 "2024-07-31T10:49:02Z")

</div>

Thanks a lot!  
After posting this I actually decided to update the files and change `headless: true` to `false` and it worked like a charm!

---

<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:** [August 2, 2024, 10:49am UTC](https://discourse.gohugo.io/t/pages-are-not-found-after-the-upgrade/50938/4 "2024-08-02T10:49:35Z")

</div>

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