-
-
Notifications
You must be signed in to change notification settings - Fork 7.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Misc case issues for URLs #1641
Comments
It's not just tags that are broken. I am migrating a blog over from Jekyll that has the url: specified with uppercase characters. The main index page references the URL the proper way (with uppercase characters), but is generating the files with lower case letters. Thus my URL's break... |
I think I am seeing a similar issue. I have a folder on disk like the following (part1=lowercase, PART2=uppercase): content/posts/part1/PART2 This folder has an http://localhost:1313/**part1/PART2/** fails to load. The relative URL to the image for the page that loads resolves to: http://localhost:1313/**part1/part2**/999.jpg This will not load in the browser running the hugo server. I assume because it's the wrong case and hugo is using a different resource-serving mechanism that is case-sensitive. http://localhost:1313/**part1/PART2**/999.jpg loads ok. I would like hugo to leave the case alone when handling URLs. |
Try setting the following option in your site config: disablePathToLower = true |
|
@gitgrimbo What OS & file system are you using? Do you this site source publicly available so we can investigate further? |
WIndows 7 and NTFS. I lower-cased all my files/folders and flattened the content folder tree after my issues and have since been ok. And I have a hunch that I also changed all the names of my E.g. from
to
The TL;DR is probably that I used the wrong mixture of Test 1With this test I can't replicate my issue. The test is:
Both the above pages work, linking to the images correctly. Test 2This test uses file names that are not E.g.
This produces the following article link from my post list: Browsing to this page fails to show the images. The HTML source is:
which is correct, but which results in the following absolute URL: which is incorrect (there is an extra Test 3Using and thus the relative paths to the images are correct. |
Note/Update: This issue is marked as stale, and I may have said something earlier about "opening a thread on the discussion forum". Please don't. If this is a bug and you can still reproduce this error on the latest If this is a feature request, and you feel that it is still relevant and valuable, please tell us why. |
Hi @bep, I can probably provide a test case which is relevant: System $ hugo version
$ cat config.yaml
$ cat themes/test/layouts/_default/list.html
$ find content
$ hugo && cat public/index.html
As we could see, the |
This is a pretty fundamental change in Hugo, but absolutely needed if we should have any hope of getting "multiple outputs" done. This commit's goal is to say: * Every file target path is created by `createTargetPath`, i.e. one function for all. * That function takes every page and site parameter into account, to avoid fragile string parsing to uglify etc. later on. * The path creation logic has full test coverage. * All permalinks, paginator URLs etc. are then built on top of that same logic. Fixes gohugoio#1252 Fixes gohugoio#2110 Closes gohugoio#2374 Fixes gohugoio#1885 Fixes gohugoio#3102 Fixes gohugoio#3179 Fixes gohugoio#1641 Fixes gohugoio#1989
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
I think there may be a regression for the URLs of uppercase tags.
In #491 urlize was changed to lowercase URLs. In #557 I think this may have been reverted?
Now when I added tag links to my post list page:
The links were broken as URLs come out as mixed case (contain uppercase letters). As a workaround, I can do this and it works.
I don't think most themes use
| lower
.cc/ @bep @spf13 who participated in both issues.
The text was updated successfully, but these errors were encountered: