Open firzen opened 10 years ago
Although this isn't a fix, here's what I've learned whilst digging around in Pico's files for a few minutes at the office today: You're best off just deleting all of the default pages in your content
directory. Optionally, you can leave 404.md
in there, as it really doesn't affect the rest of what I'm about to explain.
If you want something else in there to be the home page (rather than just index.md
), you can head to lib/pico.php
and edit this line:
else $file = CONTENT_DIR .'index';
to something like:
else $file = CONTENT_DIR .'Home';
or whatever you want your home page to be titled. Just make sure that you actually create that page in the Pico editor as well, with the same name/capitalization.
Hope this helps a little bit! By the way, I'm not sure how this affects pages in sub-directories, as I haven't played around with it yet.
I have got the same error, but only on select the "index.md" page, I can fix this with changing the line 115 in pico_editor.php and replace the if(!$file) die('Error: Invalid file');
to if(!$file) $file = 'index';
I'm afraid that @gilbitron is not really maintaining it as there are no updates in last months and couple of important fixes were submitted. So I suggest doing what I did, taht is fork and merge/fix all the stuff submitted here.
@w-vi Thanks,
I would like to suggest people use yours, I reviewed the forks and yours seems to fix most of the issues. I grabbed your code and things are working pretty well now.
@w-vi Just tested your branch, and it works great, man! Thanks.
Wait for updating...
content folder structure: ├── 404.md ├── index.html ├── index.md ├── Pico-master.md └── sub ├── index.md └── page.md
Then open the /admin url Pages shown correct in the left When I clicked on any page on the left . the right area shown "Error: Invalid file"
I position the error on pico_editor.php line 119. the file url is not corrent . when I want to edit the index.md, the $file variable = Pico-master when I want to edit the sub/index.md, the $file variable = sub when I want to edit the sub/page.md, the $file variable = page
so I suppose this is a very big bug