Page bundle kind of ignore index.md

Hello!

I have content/posts/post1/index.md
The index.md has slug in front-matter: "apost1"
And public web site has link like /posts/post1/apost1/
However I expected to have it as /posts/apost1/

What am I missing?

Hi there,

It works as expected when I try it. Do you have your site code somewhere we can have a look at? Please have a read about Requesting Help to see what information we need to be able to help you.

Hi thanks a lot, I am sorry I had to try it myslef, yes when I do hugo serve and navigate via localhost it works just fine as expected the problem is when I deploy on netlify then it works that way.

The live example is for example https://mike-klemin.com/posts/grsi/poisk-po-gosreestru-sredstv-izmerenij/
The grsi is the folder which resides in posts and has index.md with slug = poisk-po-gosreestru-sredstv-izmerenij
Probably I have to ask it on netlify forum then…

It might be something in your configuration settings, which is why we usually ask to have a look at your site code.

Yeah, well it’s rather simple one, and I do not have netlify.toml

{
  "baseurl": "/",
  "title": "МК Блог",
  "theme": "hyde",
  "enableRobotsTXT": true,
  "defaultContentLanguage": "ru",
  "publishDir": "public",
  "disableHugoGeneratorInject": true,
  "permalinks": {
    "post": "/posts/:slug/"
  },
  "menu": {
    "main": [
      {
        "identifier": "Главная",
        "name": "Главная",
        "url": "/",
        "weight": 10
      },
      {
        "identifier": "Записи",
        "name": "Все записи",
        "url": "/posts",
        "weight": 20
      },
      {
        "identifier": "О блоге",
        "name": "О блоге",
        "url": "/about/me/about/",
        "weight": 30
      }
    ]
  },
  "output": [
    "JSON",
    "HTML"
  ],
  "markup": {
    "goldmark": {
      "renderer": {
        "unsafe": true
      }
    }
  },
  "params": {
    "description": "blog"
  },
  "taxonomies": {
    "tag": "tags"
  },
  "summaryLength": 25
}

Try hugo --path-warnings

thanks! Yes, It gives warning to both pages I have issues with

Duplicate target paths: 
/home/mike/go/src/mike.klemin/Hugo/five/public/posts/poisk-po-gosreestru-sredstv-izmerenij/index.html (2), 
/home/mike/go/src/mike.klemin/Hugo/five/public/posts/ppmtomg/index.html (2)

What can cause it to duplicate? I mean I sort of understand that something like section and page ends up with same URL but not sure where and why it happens there
Edit: removing slug, helps, no duplicate. But no slug too. Also if I remove aliases it helps as well, so can have slug, but no aliases.

Again, we can more easily help you if we can actually see your site code. Please read Requesting Help .

Hello! I am sorry it took me so long, I have created a repo and if you hugo serve it the first (and only) post resides where you are expect it would
/posts/hello-world/ but if I add this repo to netlify, it makes it looks like
/posts/first/hello-world/ see here

Well, the silly me, I have not set the HUGO_VERSION and netlify used default one, which is dinosaur old, and that caused all the issues.

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