Hi,
I know that using blanks, capital and small letters or special characters isn’t the best way for file and folder names. (And I wouldn’t do it, if I start a new project.) But I have to continue work on a existing projects with blanks and capital letters in file and folder names.
I recognized that Hugo urlize nicely the URL to the page, but not to additional files surrounding a page!
I know that I could modify the URL by slug and url.
The URL of the content page is already “cleaned” from blanks and capital letters out of the Hugo box. But the URL of additional content (which are not included as page ressources Page Resources | Hugo) doesn’t get cleaned.
content/
└── posts/
└── My Directory/
├── a.md
└── image.jpg <-- this file is a logical orphan
… the image is a logical orphan; it is not related to the content file in any way. When you build the site, the orphan (and its container) are copied as is:
I use always only lowercase letter and underscores (or hyphen) for file and directory names for my own projects. But in this case I have to contribute to an already existing project. I tried to find an info in the Hugo docs but couldn’t found such an info. So I asked in my first post:
If such a rule is already documented in the Hugo docs (and I hadn’t found it), OK, then it’s my fault and everybody (also my other project partners) should follow this rules.
Now to your 2nd point
Always when I thought, I have fully understood Hugos concept of Page/Leave/Branch-Bundles I learn something knew or recognize more consequential effects of this concepts.
@jmooring You are completely right. I had a wrong folder structure, because I hadn’t fully understood the difference (and use cases) of leave and branch bundles. Thank you very much!
For the most part, Hugo doesn’t care if you use capital letters or spaces in your file and directory names, but there are at least a couple of known issues:
Use lowercase-no-spaces is not a rule, but instead guidance based on too many years of tracking down stupid (non Hugo) problems that were easily avoided.
Some operating systems are case sensitive, some are not. Some web servers are case sensitive, some are not. Your mixed case structure and code might work fine on one, but not on another.