重力 - 发展


您可以使用不同类型的开发来构建 Grav,例如Grav CoreGrav PluginsGrav SkeletonGrav Themes

重力核心

Grav 是一种现代 CMS,其中编写内容非常简单,构建页面也更加友好和直观。Grav核心特别谈到系统文件夹,它控制着Grav的一切,代表着Grav工作流程和生命周期的品质。它主要关注可以很好地编写的页面。它专注于您的内容并将您的内容转变为可导航的网站。

重力插件

插件是一款提供增强功能的软件,而这些功能最初不是由 Grav 的核心功能完成的。Grav 存储库上有许多可用的插件,这些插件显示了该网站的功能。

考虑以下与 Grav 插件相关的几点 -

  • Grav 本身是超级精简的,它只为您的网站添加所需的插件。

  • 无需等待添加您想要的额外功能。要实现这一点,只需创建一个插件来扩展 Grav。

  • 插件非常灵活和强大,可以显示站点地图、博客档案、搜索引擎、提供面包屑等。

重力骷髅

Grav框架描述了一个示例站点,其中包含 Grav 核心、插件、页面、主题。Grav 背后的最初想法是非常轻松地构建网站。开发站点所需的所有内容都放在用户文件夹中。Grav 的骨架带有插件、主题等各种依赖项,并存储在可解压的包中。

重力主题

Grav 支持不同类型的主题,这些主题构成 Grav 网站的组成部分。当您在系统上安装 Grav 时,它会附带Antimatter主题。大多数主题都带有骨架包或示例页面。您可以在user/pages文件夹下看到示例页面,它提供与骨架包类似的体验。

安装的主题需要适合您的页面的树枝模板。主题是主题和内容的结合,相当于整个网站的设计。您可以根据您的设计创建自己的树枝模板引擎。

主题/插件发布流程

您可以注意到 Grav 存储库中添加的您创建的主题或插件的一些要点。

  • 它是一个由麻省理工学院授权的开源软件。

  • 它有README.md文件,指定项目的安装过程和配置。

  • 它包含blueprints.yaml文件,其中包含有关资源的信息,可以在每个插件和主题的根目录中找到。

  • Contains CHANGELOG.md file which includes version of the theme or plugin and displays the information whenever changes made to the file.

  • Creating releases are better ways to place your completed theme or plugin on the GitHub. If there is no release, then you won't find your plugin or theme.

  • Add the details about your plugin or theme and do a test to ensure its working functionality.

ChangeLog Format

The changelog format is written in the Markdown syntax which keeps the content and visual display separate. It uses simple CSS which is displayed in the following format.

# vX.Y.Z
## 01/01/2015
1. [](#new)
   * New features added
   * Another new feature
2. [](#improved)
   * Improvement made
   * Another improvement
3. [](#bugfix)
   * Bugfix implemented
   * Another bugfix
...repeat...

GitHub Setup

GitHub is a largest open community which shares your projects with the users, get feedback and contribute to the repositories hosted on GitHub.

Clone the URL of external repository into single project folder on your local system. You can clone the external Git repository to new repository as shown in the steps below.

Open the command line and create folder called "my_project".

$ mkdir my_project
$ cd my_project
$ mkdir Grav
$ cd Grav
$ git clone https://github.com/getGrav/Grav.git
$ git clone https://github.com/Grav_project/Grav-plugin-error.git
$ git clone https://github.com/ Grav_project /Grav-plugin-problems.git
$ git clone https://github.com/ Grav_project /Grav-theme-antimatter.git

Here Grav_project is a repository where you will get all the files and folders related to this repository will be saved in the /my_project/Grav folder. Grav includes dependencies such as error plugin, problems plugin and Antimatter theme.

You can setup the test site for Grav by using the bin/Grav new-project command. We need to develop the cloned code from the web root. So we have to symbolically link the related parts using -s flag to the bin/Grav new-project command.

Create one configuration file in a new folder called .Grav/ to find the repository by using the command and you need to create this under the root directory.

$ cd
$ mkdir .Grav
$ vi .Grav/config

Navigate to your Grav folder and setup the symbolically linked site using -s flag.

$ cd ~/Projects/Grav/Grav
$ bin/Grav my-project -s ~/www/Grav

Here, www is a root folder and Grav is the location where you're going to create the test site.

Grav Development