-
Notifications
You must be signed in to change notification settings - Fork 31
Fix subdirectories #4
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
base: master
Are you sure you want to change the base?
Conversation
do_open(), do_save(), and do_delete() now support subdirectories and index.md files. Instead of using basename() on the URL, we are now using parse_url(). Currently, Pico does not support files with the same names as directories. This plugin will use the correct version based on a trailing slash being used for directories and no trailing slash being used for files. However, this will not fix that the directory will override the file on the Pico front end.
|
This is meant to address issue #2, but I can't seem to figure out how to link them in GitHub. I apologize for the duplicate issue. |
|
This didn't fix my issues. If anything now I can't edit anything. |
|
Thanks for the feedback. Hmm... I'm not sure what the problem could be. Where there any error messages, or did it just not work? |
|
I have no idea. I turned on all PHP errors but nothing showed up. All I get is Error: Invalid file. I can successfully create and edit a file. But as soon as I click on another file the error message pops up. So something is up with opening them. |
|
I did some probing and it's line 122 that goes off. I.e the second die(error) in do_open. I think it's due to my site being in a subdirectory. print_r($parse_file_url) echo CONTENT_DIR . $parse_file_url['path'] As you can see /pages is my subdirectory and is in both path and the physical file path. |
|
It will be nice, to be able to create subdirictory and a new page in subdirictory; btw, - thanks |
|
@exhnozoaa I've taken your changes and create a new pull request with some more improvements (#5) |
|
@varakh - I haven't use pico for a while, - so can't tell you right now, but if you can describe the error in my version, I'll be able to update it. |
|
@varakh have you update base_url ? |
|
all scripts use this var when load resources like so if you change your base_url, by moving your project from root dir, please be sure to update this var. |
|
@varakh - have you check error log ? can you show an example? |
|
@pomaxa I just moved it to / and won't try it in /blog/ again. Guess I won't be able to figure out a solution to this problem. But nevermind. It's okay like this. Thanks anyway. |
In this fork/branch, do_open(), do_save(), and do_delete() now support subdirectories and index.md files. Instead of using basename() on the URL, it is now using parse_url().
Currently, Pico does not support files with the same names as directories. In this fork/branch, the plugin uses the correct file/directory based on a trailing slash being used for directories and no trailing slash being used for files. However, this will not fix that the directory will override the file on the Pico front end (a different bug for a different project).