Administration

by Gisle Hannemyr

This chapter discusses some of the interfaces and tools you may use in the day to day administration of a Grav website.

Table of contents

Grav plugins discussed in this chapter: None.

Introduction

The file system folder structure is what keep a Grav website organized.

For a description, see GetGrav.org: Folder structure.

Configuration files

All Grav configuration files are written in YAML syntax with a .yaml file extension.

The Grav configuration are kept in .yaml-files. There are two configuration directories:

The default system configuration file is system/config/system.yaml. It contains all available settings. To customize the settings for your website, edit or add settings to user/config/system.yaml. Any setting in this file with the same structure and naming will override the default settings.

timezone: 'Europe/Oslo'

To have a ISO-style short date format and long date format with a 24 hour clock use:

pages:
  dateformat:
    short: 'Y-m-d'
    long: 'Y F j - H:i'

See PHP documenattion for date to learn how these strings are contructed..

The file user/config/site.yaml contains settings specific to a particular website.

title: MyWebSite
author:
  name: Joe Blogger
  email: 'joeblogger@example.com'
metadata:
    description: 'My very own website'

The title and metadata goes into the <head>, in the places you would expect.

Administration panel

The Grav administration panel is a plugin that provid a administrative interface GUI. This GUI is optional, the site can be fully administrated from the CLI.

To install:

$ bin/gpm install admin

It depends on three additional plugins, and will install them if they are missing:

After installing the plugin, visiting the site will produce this ascreen:

grav_admin01.png
Visiting the site after installing the Admin plugin.

Doing this will create /user/accounts/username.yaml (where userrname is the chosen username) . It will contain a cleartext password that will be converted to hashed password the first time you login.

noteUsing the GUI to clear the cache will break the CLI command: bin/grav cache. The reason is that the web server sets permissions that denies access to the human user of the CLI, resulting in an error. Workaround: Don't use the CLI for clearing the cache. If this has happened, sudo fixgravperms.sh restore sanity.

You can access the admin panel by using a browser to visit the path /admin below you siteroot (e.g. http://example.com/admin). You log in with the username and password set in the YAML file you configured earlier.

See also: GetGrav.org: Admin panel introduction.

The command line

Grav commes with two programs that can be run from the command line.

Grav command

To ger more information, the following two commands are helpful:

$ bin/grav -h
$ bin/grav list

To clear the cache:

$ sudo fixgravpers.sh
$ bin/grav cache

Source: GetGrav.org.

Grav package manager

Grav comes with its own package management system that is used from the CLI (bin/gpm) for simple installation and upgrading of the core and extensions (skeletones, themes and plugins).

To update the core;

$ bin/gpm selfupgrade

GPM Releases Configuration: Stable

You are already running the latest version of Grav (v1.6.24) \
  released on Mon Apr 27 22:11:01 2020

Final word

[TBA]


Last update: 2020-05-07 [gh].