Folder in content and file with same name, not generatig page

Hi,

I need a bit of advise please. I am moving some of my sites from 0.151.2 to 0.153.5.

I read about changes to site.matrix but may be a bit confised about it, hence asking for some feedback.

in /content folder I got a file

services.md (along with services.pl.md and services.sv.md) that generates /services/ page

But I also got /content/services folder there with contain subpages to few markdown files.

When Folder /services/ exist along with services.md directly in /content folder, the services.md is not generating /services/ but subpages, that are from inside the folder are generated ok.

What’s the best approach to that?

I can rename folder services to services_list and it will work as intended.

ps. I am using this approach (part)
```
{{ $services := (site.GetPage “/services_list”).RegularPages }}
```
to get a list of services from the folder on the home page.

Moving the markdown folder into the services folder and renaming it index will probably get interferenced and will list itself in GetPage approach, which I do not want really.

See Page bundles

In your case I would guess that the best would be to move services.md down to services/_index.md.

I tend to have trouble understanding how this works correctly.

moved services.md (as well as services.pl.md and services.sv.md) inside /content/services folder and renamed _index.md (and _index.pl.md and _index.sv.md).

Frontmatter _index.md got

url: '/services/'

The /services/ are still returning 404.

Inside services folder I got other markdown files and they are generating, for example,/services/risk having in frontmatter:

url: '/services/risk/'

The services is generated when _index.md is renamed to index.md, but in that case, it becomes a page, and none of the sub-pages are generating, like /services/risk.

Sorry, a bit confused.

Example:

Hugo 0.151.x and 0.152.x

/content
/content/services.md (url: '/services/')
/content/services/service1.md (url: '/services/service1/')
/content/services/service2.md (url: '/services/service2/')

the services.md generates page for /services/ and service1 and service2 for sub-pages

in Hugo 0.153.x

/services/ is 404
/services/services1/ working
/services/services2/ working

Hi @bep I downgraded a site on which I found issues to 0.152.2 and attached you to the source on Github if you want to investigate (do not bother with /layouts/_partials/frontpage/services.html as thats other issue that I know how to sort).

Ah, rookies mistake, as I disabled Sections in confit

disableKinds = ['taxonomy', 'term', 'section']

This is why I’m getting an error.

I got some work to do with content to finally move them to Page bundles for future proof.

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