Relative project paths?
AstraLuma opened this issue · 6 comments
#28 mentions that using relative paths in sublime project files (essential for using the repo in more than one place) was supposed to be in 2.2, but I just installed the plugin and it still hasn't been fixed.
Do you have an updated idea when this will happen, or why the default isn't just "one site per project"?
Hey @astronouth7303
Thanks for using the package and commenting!
I was hoping to add that feature in 2.2, however I ran into a few snags that I haven't figured out a feasible solution for. Namely - how can you reliably find the home path of a project in Sublime. It is possible to have multiple top-level folders, which means that there are multiple values returned in the project settings folders
key.
We could make an assumption that the first path in the folder array is the one we use, but that seems lazy. We could maybe use a popup menu to select which home path to use (but at that point, you might as well use full paths).
Do you have any ideas or suggestions - or things you've seen in other packages - that I could look at? Let me know!
I think the paths that Sublime uses are relative to the project file. eg, '.'
is the directory of the project file.
Likely correct, however here is the specific issue. Feel free to test if you want. Create a new project and save the sublime-project
file in a location other than your actual project. This is very common if you keep all project settings in one directory on your machine.
Open that file and you'll see that you can access the path of the project folder using folders[0].path
. Now - add another folder to your project (from the menu) and check your settings file again. I now have 2 potential paths in my project, which makes finding the project root path very difficult (why would you have multiple folders? - maybe you keep a central repo of assets that you use across different projects/blogs).
So that's my dilema 😉 . Until I figure out a good way around that, I don't feel like requiring the full path is all that bad.
Maybe this is a case of "good enough"? If it's a single project root (like all the projects I've ever done), then autodetect it and call it a day. If there's only one root with any jekyll magic folders in them, maybe whine a bit at the user. If it detects multiple jekyll projects, fall over and complain loudly.
Let me take a look at what I can do. Thanks!
Closing as should be available using jeykll_auto_find_paths
.