Closed robertpi closed 2 years ago
I was thinking about this, the issue seems to stem from the way the loaders talk to the generators. First the loads are run and enumerate the file system and populate the SiteContents with what ever data they feel necessary then the file system is enumerated by fornax itself and each pages is generated, and during the generation phase it's given chance to look up if a loader stored any data for it.
Wouldn't it be better to have the data from sitecontent passed directly to the generator? Eliminating the double enumeration of the file system. It would mean static content would also need to loaded in someway, but I think that's do able.
It's a big change, so I thought I discuss here before trying to implement.
Describe the bug Fornax can't support files with non url safe characters. If a mark down file in the posts directory contains a space in the file name, it will break the default template.
To Reproduce Add a file named 'post with spaces.md' to the post directory Test the template, it will fail to load.
Expected behaviour The template should load
Environment (please complete the following information):
Additional context The url encoding seems to come from this method:
Building the site will fail with this error:
We could fix this by calling
System.Web.HttpUtility.UrlDecode
, but that results in the following error:Again, we could fix this by calling
System.Web.HttpUtility.UrlDecode
, but means the generated Url for the page is incorrect because it has not been correctly url encoded. This is harder to do, as we need to encode the file and directory names but the directory separator characters.