Files
natascha-rieter-nl/README.md
T

2.3 KiB

natascha-rieter.nl — Grav CMS

Local development

Requires Docker. To set up from scratch:

make setup

This starts the container and installs all plugins listed in plugins.txt via GPM.

Other commands:

make start              # start the container
make stop               # stop the container
make install-plugins    # (re)install plugins from plugins.txt

Site runs at http://localhost:8080.

Repository structure

This project uses two git repositories:

Repo Contents Purpose
natascha-rieter-nl (this repo) Docker setup, Makefile, scripts Local dev and server management
natascha-rieter.nl-user Contents of user/ Deployed to production, synced with Git Sync

The user/ folder in this repo is linked to the user repo via git subtree.

What goes where

Path Description In git
user/config/ Site and plugin configuration user repo
user/pages/ Page content user repo
user/themes/natascha/ Custom theme user repo
user/plugins/ Plugins (see plugins.txt) no
user/accounts/ Admin credentials no
user/data/ Runtime data no
user/cache/ Generated cache no

Deployment

Production runs on a VPS with Apache. The user repo is cloned into the Grav user/ folder on the server and kept in sync via the Git Sync plugin.

Server config

Copy .env.example to .env and fill in your values (gitignored):

SERVER=user@example.com
WEBROOT=/path/to/public_html
USER_REPO=ssh://git@gitea.example.com/user/repo.git

First-time server install

make server-install

This SSHes into the server and runs scripts/server-install.sh, which installs Grav and clones the user repo.

Deploying changes

make deploy             # push local user/ changes to the user repo on Gitea
make pull-content       # pull editor's content changes back locally

After make deploy, the Git Sync plugin on the server pulls the changes automatically via webhook.

Server maintenance

make server-install-plugins   # install/update plugins from plugins.txt on server
make server-upgrade-grav      # upgrade Grav core on server

Plugins

Plugins are not committed to git. The full list is in plugins.txt.

  • Locally: make install-plugins
  • On server: make server-install-plugins