CMSというとシステムという文字が入っているためにどうしても仰々しいものが思い浮かんでしまいます。実際にはそのようなことはなく、大抵のCMSはもっとシンプルな構成でも十分と言えるでしょう。 GravはそんなシンプルなCMSで、データベースは使わずにファイルベースの構成になっています。

Gravの使い方

GravはCLIが用意されています。

$ ./bin/grav
Grav CLI Application version 0.1.0

Usage:
  command [options] [arguments]

Options:
  -h, --help            Display this help message
  -q, --quiet           Do not output any message
  -V, --version         Display this application version
      --ansi            Force ANSI output
      --no-ansi         Disable ANSI output
  -n, --no-interaction  Do not ask any interactive question
  -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Available commands:
  backup       Creates a backup of the Grav instance
  clean        Handles cleaning chores for Grav distribution
  clear-cache  Clears Grav cache
  composer     Updates the composer vendor dependencies needed by Grav.
  help         Displays help for a command
  install      Installs the dependencies needed by Grav. Optionally can create symbolic links
  list         Lists commands
  new-project  Creates a new Grav project with all the dependencies installed
  newuser      Creates a new user
  sandbox      Setup of a base Grav system in your webroot, good for development, playing around or starting fresh

Gravコマンドを使って新しいプロジェクトを作成します。ファイル構成はこんな感じです。

サイトを確認してみます。

コンテンツはこんな感じでMarkdownを少し拡張したイメージです(上部のメタ情報など)。

サイト全体の設定はYAMLファイルで記述します。

GravはMarkdownをコンテンツとしつつ、さくさくとサイトを作っていけます。コメントなど動的な仕組みが欲しければFacebookやDisqusを使えば良いでしょう。静的なサイトであればパフォーマンスもよく、アクセスが伸びても問題なく運用できることでしょう。

GravはPHP製、MIT Licenseのオープンソース・ソフトウェアです。

Grav - A Modern Flat-File CMS | Grav getgrav/grav