Hugo is rendering post with (almost) entire disk file path

I’ve been developing my first Hugo site for a while but I just can’t figure this one out.

I have a pretty basic source organization:

   ├── content/
        └── _index.md
        └── blog/
            ├── firstpost.md

When I have the url for firstpost.md defined in Front Matter the result is as expected (it equals the content organization). But when I don’t, the post takes it’s path on my local machine and translates it into its position in the rendered site.

Let’s say, this is it’s place on my disk:
HD/Users/User/Dropbox/../ThisFolder/../project/site/content/blog/fistpost.md

This is rendered into:
project/dist/ThisFolder/../project/site/content/blog/fistpost/index.html

The wanted path is this:
project/site/blog/fistpost/index.html

As I said, it does work if I set the URL in Front Matter to "blog/firstpost"

There is nothing significantly interesting about ThisFolder folder. I just don’t understand why this keeps happening. Any ideas? I can still move around this with specifying the url but I would really like to know what I am doing wrong.

This is my Front Matter:

+++
date = "2017-05-23T21:46:39+02:00"
description = "TEST"
draft = false
h1 = "TEST"
title = "TEST"
type = "page"
+++

And this is my config:

baseurl =                       "https://mysite.sk/"
languageCode =                  "sk-sk"
defaultContentLanguage =        "sk"
title =                         "Title"
publishDir =                    "../dist"
contentDir =                    "content"
layoutDir =                     "layouts"
canonifyurls =                  true

enableRobotsTXT =               true
disableHugoGeneratorInject =    true

I would be very thankful for any idea!

I’m getting a little bit confused since you’re asking about desired file paths and not about URLs, but you have Hugo going up a directory and publishing to dist at the same level as your project folder.

I think what you want is…

publishDir =                    "site"

Very sorry for the confusion. I made a mistake in the original post. Let me try to make it clearer.

This is the desired structure of my source and publish directories:

├──folder1
    └── folder2
        └── folder3  
            └── project
                ├── site 
                |   ├── config.toml
                |   ├── layouts
                |   └── content
                |        └── post
                |            └── firstpost.md
                └── dist 
                    └── post
                        └── firstpost
                            └── index.html

What actually happens in my dist folder is this:

└── dist
    └── folder1
        └── folder2
            └── folder3  
                └── project
                    └── site
                        └── content
                            └── post
                                └── firstpost
                                    └── index.html

The folder1 folder is not my local user root. This makes it even more strange to me. When I move the whole project out of that folder1 it works fine. It must be something with my local machine.

Do you have an idea what could be happening here? Why could Hugo be taking that path and aplying it on the destination?