Learn GRAV problems

I’ve been going through the Learn GRAV documentation, and have a few problems while trying out the commands.

I downloaded the zip file for latest GRAV and installed on OS X in the MAMP directory. I created another page, 02.mypage as outlined in the documentation and created a bootstrap theme with no problem.

Next, while trying the bin/grav new-project …/mygravsite command I got the following error:

[RuntimeException]                                                                                                                    
  The .git directory is missing from /Applications/MAMP/htdocs/mygravsite/vendor/erusev/parsedown-extra, see http://getcomposer.org/commit-deps for more information 

Checking the website in the error message seems to indicate that the vendor directory should be in a .gitignore file. So, I assumed this was not an issue.

Next, I used the bin/gpm install bootstrap command to get the bootstrap theme. Everything seems to work except for the image file I had put on 02.mypage. The image and default.md file are in the directory, but the ima ge is showing a broken link icon, and it doesn’t appear that media functionality is being called to resize the image. There is not image file in the root /image directory as there is on the original project.

I assume this must be a bug with the media code, but I may need to just correct some config from the new-project directory?

I think that you need to have Grav installed via GitHub, or at the very least, you would need to delete the vendor/ folder, and then regenerate it via composer update in order to be able to use the bin/grav new-project command.

This is because we strip out a lot of extra files and folders (including .git) in the release zip packages because they would be pretty huge otherwise.

Regarding the broken link for your image. Did you clear the cache?

$ bin/grav clear-cache

That’s the first step to try before we debug further.

I have tried the clear-cache command, same error on the image. I was surprised to find my added page (02.mypage) being cloned in the new project. Is this an error?

I going through the git install process now. Can you explain the difference between sandbox and new-project? They look the same.

I installed the git archive in my ~/Projects folder and manually created a symbolic link to it from htdocs.

I then tried making a new-project using the -s option and put the new project also in my ~/Projects directory instead of htdocs. It creates the project directory, but fails during the Symlinking bits with error: No local configuration available, aborting …
The theme files were missing from the project directory.

So, the workflow I am envisioning is to have the grav git project in my Projects directory and create sandbox (new-projects) from it for testing and learning also in my Projects directory. I can create the symbolic link manually, but was trying to understand the -s option for sandbox and new-project?

Ok a few things:

  1. The idea/intention is that you keep a stock base Grav install and use that to build sanboxes/newsites from that. The reason for this is that it basically uses the current site as a template to create a new site.

  2. new-site is a combination of sandbox then install. *Sandbox *simply copies over the core Grav bits, but doesn’t install/link the theme/plugins. Install does the installation of those plugins and themes or symlinks with -s option.

  3. The -s option requires a config file. There’s an example of this in the docs under GitHub Setup

FWIW, we use the -s option for all our test installs. Basically we clone all the Grav plugins and themes along with Grav itself, into a directory (~/Projects/grav/), and then setup the .grav/config file to point to that projects directory. Using this system, any update in the repos are automatically reflected in the linked versions, making it easy to keep all sites up to date and current.

Thanks for the clarification of using new-project. I was interested in adding more pages, so had just wanted to clone a project so as to keep the original project. I only skimmed through the GitHub Setup.

So, I have setup grav as a base project and cloned (new-project) it for my testing.
I have not symbolic linked the new project to the base project, but I assume that I can use self-update to update the project.