Recently I’ve been exploring online (aka “cloud”) IDE’s for use with my various Grav sites and to also recommend for other educators who use Grav with GitHub (as I do). Yesterday I happily discovered SourceLair, which provides a straightforward online environment to develop and test a variety of Web project types all within your Browser (or in my case on my Chromebook). Other noteworthy highlights about SourceLair include a full-screen Terminal and a public URL which can share with others to view your in-development work.
I’ve been pretty impressed so far with how SourceLair lets me remotely work on my Grav sites, preview/debug them using the built-in PHP server, and then push the resulting changes to GitHub (which are then automatically deploy using a third-party service such as Deploy or with SourceLair’s built-in support for git-ftp) - all within my Web Browser! SourceLair also provides university professors and students with access to one free project, along with several paid plans for Web developers - just contact them for details.
Sign-up for a trial SourceLair account by choosing “Sign up with GitHub” and then provide the requested GitHub credentials and other required account creation information.
Figure 1. SourceLair sign up page.
Once you’ve signed up for SourceLair press the “Start a project” button on your account welcome page.
Figure 2. SourceLair welcome page.
Press the “Clone a project” button to clone a GitHub project to your SourceLair account.
Figure 3. SourceLair begin a project page.
Choose the GitHub repository you want to clone to SourceLair.
Figure 4. SourceLair clone project page.
Choose “PHP” for the project type.
Figure 5. SourceLair project type page.
As Grav is a flat-file (no database) CMS, choose “None” on the Database page.
Figure 6. SourceLair database page.
Name your SourceLair project (a default name will be provided).
Figure 7. SourceLair name project page.
At this point SourceLair will complete the installation of your project. If your GitHub repository only contains your Grav site “User” folder you are all done so you can skip to the bottom of this article. If your GitHub repository is an entire Grav site (i.e. including PHP files, etc.) then one more step is required so that the automatically updated Composer installs (indicated in the included “composer.json” file) are not included in your initial GitHub commit/push.
Figure 8. SourceLair initial project display.
Press the “Terminal” tab located on the bottom part of the current SourceLair project page.
Figure 9. SourceLair terminal panel.
Enter the following Git command in the Terminal panel and then press the “Return” key.
git checkout . && git clean -f -d
Figure 10. SourceLair terminal panel with Git command entered.
I would suggest you test everything out by making a small edit in one of your Grav page files, and then preview the files to be committed to your GitHub repository. To perform a commit in SourceLair using the left-hand toolbar, press the “Commit” (checkmark) button to preview/commit your changes and then the “Push” (up arrow) button to push all of your committed changes.
Figure 11. SourceLair commit dialog.
You are now ready to edit your Grav site using SourceLair, and if you have an entire Grav site stored in your GitHub repository you can also preview your site in-progress by pressing the “Preview” (eye) button on the left-hand toolbar.
Figure 12. SourceLair site preview using the built-in PHP server.
If you just have your Grav ‘User’ folder stored in your GitHub repository, you might find SourceLair’s built-in Markdown file preview as a helpful alternative to a full site preview.
Figure 13. SourceLair markdown file preview.
I hope you find SourceLair as useful as I have, especially when used with GitHub!
Looking to help educators at your organization leverage the capabilities of Grav? I offer workshops, premium support and custom development - let's connect!
Free 15 Minute Consultation   @hibbittsdesign   firstname.lastname@example.org