grav README

The project's README from github.com/getgrav/grav. As one markdown file: README.md.

Grav

PHPStan Discord PHP Tests OpenCollective OpenCollective OpenCollective

Grav is a Fast, Simple, and Flexible, file-based Web-platform. There is Zero installation required. Just extract the ZIP archive, and you are already up and running. It follows similar principles to other flat-file CMS platforms, but has a different design philosophy than most. Grav comes with a powerful Package Management System to allow for simple installation and upgrading of plugins and themes, as well as simple updating of Grav itself.

The underlying architecture of Grav is designed to use well-established and best-in-class technologies to ensure that Grav is simple to use and easy to extend. Some of these key technologies include:

Requirements

Documentation

The full documentation can be found from learn.getgrav.org.

QuickStart

These are the options to get Grav:

Downloading a Grav Package

You can download a ready-built package from the Downloads page on https://getgrav.org

With Composer

You can create a new project with the latest stable Grav release with the following command:

composer create-project getgrav/grav ~/webroot/grav

From GitHub

  1. Clone the Grav repository from https://github.com/getgrav/grav to a folder in the webroot of your server, e.g. ~/webroot/grav. Launch a terminal or console and navigate to the webroot folder:

    cd ~/webroot
    git clone https://github.com/getgrav/grav.git
    
  2. Install the plugin and theme dependencies by using the Grav CLI application bin/grav:

    cd ~/webroot/grav
    bin/grav install
    

Check out the install procedures for more information.

Adding Functionality

You can download plugins or themes manually from the appropriate tab on the Downloads page on https://getgrav.org, but the preferred solution is to use the Grav Package Manager or GPM:

bin/gpm index

This will display all the available plugins and then you can install one or more with:

bin/gpm install <plugin/theme>

Updating

To update Grav you should use the Grav Package Manager or GPM:

bin/gpm selfupgrade

To update plugins and themes:

bin/gpm update

Upgrading from older version

Migrating from Grav 1.x to Grav 2.0? Grav 2.0 is a major release with a PHP 8.3+ baseline and a modernized core, and upgrading requires a dedicated migration — bin/gpm selfupgrade alone will not take you across the 1.x → 2.x boundary. Follow the step-by-step guide at getgrav.org/migrate-to-2 before running any upgrade command.

Within a major version, bin/gpm selfupgrade handles point upgrades. The following guides cover in-place upgrades between minor releases of Grav 1.x:

Contributing

We appreciate any contribution to Grav, whether it is related to bugs, grammar, or simply a suggestion or improvement! Please refer to the Contributing guide for more guidance on this topic.

Security issues

If you discover a possible security issue related to Grav or one of its plugins, please email the core team at [email protected] and we'll address it as soon as possible.

Getting Started

Exploring More

Backers

Support Grav with a monthly donation to help us continue development. [Become a backer]

Supporters

Support Grav with a monthly donation to help us continue development. [Become a supporter]

Sponsors

Support Grav with a yearly donation to help us continue development. [Become a sponsor]

License

See LICENSE

Running Tests

First install the dev dependencies by running composer install from the Grav root.

Then composer test will run the Unit Tests, which should be always executed successfully on any site. Windows users should use the composer test-windows command. You can also run a single unit test file, e.g. composer test tests/unit/Grav/Common/AssetsTest.php

To run phpstan tests, you should run:

grav (getgrav/grav)

Searching Database…

15.7K ·GitHub
这是什么?Grav 是一个快速的纯文件 CMS,也就是一种搭建网站的平台,内容以 Markdown 文件的形式保存,而不是存在数据库里。零安装——解压 ZIP 压缩包,网站就已经能跑起来了。
所以完全没有数据库——我的内容存在哪里?只存在文件里:页面用 Markdown,配置用 YAML,模板用 Twig。没有任何需要安装和维护的数据库层。
我该怎么把网站跑起来?有三种方式:从下载页面下载现成的完整包;用 Composer 创建项目;或者把仓库克隆到你的网站根目录,再运行 bin/grav 命令行工具来安装插件和主题的依赖。
服务器需要什么条件才能运行它?PHP 8.3 或更高版本,加上所需的 PHP 模块,由 Apache 或 IIS 提供服务。整套环境就这么简单——不需要架设任何数据库服务器。
升级到新版本麻烦吗?在同一个大版本内很轻松:bin/gpm selfupgrade 就能处理小版本升级。但从 1.x 跨到 2.0 就不一样了——需要专门的迁移,所以在运行任何升级命令之前,请先按照 getgrav.org/migrate-to-2 上的指南操作。
给它写内容需要会 PHP 开发吗?不需要——日常内容就是 Markdown 加上 YAML 配置。只有当你想自己开发插件或主题时,才需要用到 PHP。
怎么添加插件或主题?用 Grav 包管理器(GPM):bin/gpm 可以列出所有可用的插件和主题,并在命令行里安装你选中的那些。这是官方推荐的方式,比手动下载插件或主题更好。
它底层用了什么技术?模板用 Twig,Markdown 由 Parsedown 渲染,配置用 YAML,缓存、事件和命令行控制台用 Symfony 组件,依赖注入容器用 Pimple,动态图片处理用 Gregwar 库。
除了从零开始,有没有更快的上手方式?有——免费的 Skeleton(骨架):这些是预先搭建好的网站完整包,可以直接拿来用,不用自己去组装核心、插件和主题。文档的 Getting Started 部分有它们的链接。
它是免费的吗?是的——Grav 基于 MIT 许可证开源。项目通过支持者和赞助者的自愿月度或年度捐助来为开发提供资金。
What are similar projects?Kooboo, gophenberg, halo, payload, Instatic, october, zola, flarum
Creator
getgrav
Size
33.6 MB
Stars
15.7K
Age
12y
Commits · 90 Days