Hey all,
Transferring a site to a linux based hosting solution and very quickly learnt today about its case sensitivity 😅.
As the site was originally hosted on Windows this was never a problem to have a file like Hero.cshtml and have it be referenced in code like /Views/Partials/Blocks/hero.cshtml
However, now that we have the site running, its of course complaining that it cant find it.
I went through, adjusted all the file names so that they match exactly whats being referenced in code, however Im not entirely sure on how to get Git (In this case, the GUI Sourcetree) to pick up filename case changes.
Anyone ever dealt with this sort of thing?
Cheers!
Alternatively, reference them properly in the code? So that it's actual file changes instead filename changes?
h
huwred
06/28/2024, 7:42 AM
beat me to it Seb 🤣
t
Tom Chance
06/28/2024, 7:42 AM
Well I've certainly got a fun task ahead! Thanks for the SO Sebastiaan!
With the code references, yeah we had a foreach looping through a blocklist and matching the alias to a filename like so:
Copy code
csharp
@foreach(var block in componentPicker)
{
var blockContent = block.Content;
@Html.Partial("Components/Blocks/" + blockContent.ContentType.Alias, block)
}
But the file names got made with capitals >.<
h
huwred
06/28/2024, 7:44 AM
you could also capitalize blockContent.ContentType.Alias in your code