Static site to Grav: best way to sync with Git?

Hey folks, discovered Grav today and am trying to figure out if it might meet my needs.

Right now I’m hosting my static site on Netlify. However, I’d like a few things that Netlify can’t do for me, and I think Grav can help. However, one aspect of Netlify that I enjoy is that I can write my post in VS Code, commit it to a repo, run the entire site locally to test things out, and git push to publish. I know that there’s a git sync plugin, but is there an easy way to use that for more of Grav’s functionality?

I’m almost certainly going to need to do some development work on my site, since I want a sort of self-hosted Patreon-style sponsorship system, and that’ll probably require some plugins/templating. So, ideally, I want to spin up my site in a VS Code dev container, complete with all current registered users and other data, and make sure any plugins/templates I write work before pushing them to production. I have some questions about how to pull this off.

First, how should I handle plugins? I can currently bring up my site in a dev container. The git sync plugin is installed, so presumably I can add my repo and eventually the site will push/pull there. Should I sync plugins alongside the site, and commit their contents into my site’s repository? Or are plugin names/versions recorded somewhere such that launching a site with missing plugins installs them first, and only committing that name/version lockfile would get me what I need?

Next, themes. I’m assuming whatever answers the above question applies to them as well?

Finally, is anyone doing something like this, and are there any other caveats I should be aware of? Essentially, I want as much as possible of my site’s source of truth to be a git repo so I can build what I need and not have to mess around with exporting/importing databases to make it happen. And if I need to commit absolutely everything then I will, but I’d rather not if I don’t have to.

Thanks.

1 Like