蓝图是有关资源(信息来源)的元数据信息.它有两个目的和减号;
首先是资源标识本身.
其次是关于表格.
此完整信息保存在每个插件或主题中的 blueprints.yaml 文件中.
在 blueprints.yaml 中为每个主题和插件定义文件标识.在蓝图未经过格式化和完美编译之前,不会在Grav存储库中添加资源.
name: plugin name version: 0.6.0 description: Adds an advanced plugin to manage your site icon: empire author: name: Team Grav email: devs@getGrav.org url: https://img01.yuandaxia.cn/Content/img/tutorials/grav/ homepage: https://img01.yuandaxia.cn/Content/img/tutorials/grav/Grav-plugin-assets keywords: assets, plugin, manager, panel bugs: https://img01.yuandaxia.cn/Content/img/tutorials/grav/Grav-plugin-assets/issues readme: https://img01.yuandaxia.cn/Content/img/tutorials/grav/Grav-plugin-assets/blob/develop/README.md license: MIT dependencies: - form - email - login form: validation: loose fields: Basics: type: section title: Basics underline: false enabled: type: hidden label: Plugin status highlight: 1 default: 0 options: 1: Enabled 0: Disabled validate: type: bool
以下几个属性是可选的,有些属性用于提供您的身份和资源.
Sr.No. | Properties&描述 |
---|---|
1 | 名称* 提及资源名称. |
2 | 版本* 指定资源的版本. |
3 | description * 提供有关资源的简要说明.它不应超过200个字符. |
4 | icon * 指定用于开发的图标库一个新的主题或插件. |
5 | author.name * 指定开发人员的名称. |
6 | author.email(可选) 指定开发人员的电子邮件地址. |
7 | author.url(可选) 指定开发者的URL主页. |
8 | 主页(可选) 指定分配为您的资源主页提供了网址. |
9 | docs(可选) 指定文档链接你已经为你的资源写了. |
10 | demo(可选) 指定演示资源的链接. |
11 | 指南(可选) 指定资源指南或教程的链接. |
12 | 关键字(可选) 指定与资源相关的关键字列表. |
13 | 错误(可选) 指定可以报告问题或错误的网址. |
14 | 许可证(可选) 指定您的资源许可证,即麻省理工学院,GPL等. |
15 | 依赖关系(可选) 指定插件或主题所需的依赖项名称. |
以下是登录插件蓝图 :
name: Login version: 0.3.3 description: Enables user authentication and login screen. icon: sign-in author: name: Team Grav email: devs@getGrav.org url: https://img01.yuandaxia.cn/Content/img/tutorials/grav/ keywords: admin, plugin, login homepage: https://img01.yuandaxia.cn/Content/img/tutorials/grav/Grav-plugin-login keywords: login, authentication, admin, security bugs: https://img01.yuandaxia.cn/Content/img/tutorials/grav/issues license: MIT
你可以填写如果您希望主题或插件可以从管理界面直接配置选项,则使用表单的blueprints.yaml 文件.可以通过管理插件配置此资源的一部分,该插件由表单元数据定义.
以下是Archives Plugin archives.yaml 文件的示例.
enabled: true built_in_css: true date_display_format: 'F Y' show_count: true limit: 12 order: by: date dir: desc filter_combinator: and filters: category: blog
这些是插件的默认设置.要在不使用Admin插件的情况下配置它们,用户必须在 /user/config/plugins/archives.yaml 文件夹中复制此文件并进行更改.您可以正确提供 archives.yaml 文件;您可以选择从用户更改管理界面中的设置.
保存更改后,它将自动写入 < your_folder_name>/user/config/plugins/archives.yaml .
Archives插件的 blueprint.yaml 文件包含如下所示的结构和减号;
name: Archives version: 1.3.0 description: The **Archives** plugin creates links for pages grouped by month/year icon: university author: name: Team Grav email: devs@getGrav.org url: https://img01.yuandaxia.cn/Content/img/tutorials/grav/ homepage: https://img01.yuandaxia.cn/Content/img/tutorials/grav/Grav-plugin-archives demo: https://img01.yuandaxia.cn/Content/img/tutorials/grav/ keywords: archives, plugin, blog, month, year, date, navigation, history bugs: https://img01.yuandaxia.cn/Content/img/tutorials/grav/Grav-plugin-archives/issues license: MIT form: validation: strict fields: enabled: type: toggle label: Plugin status highlight: 1 default: 1 options: 1: Enabled 0: Disabled validate: type: bool date_display_format: type: select size: medium classes: fancy label: Date Format default: 'jS M Y' options: 'F jS Y': "January 1st 2014" 'l jS of F': "Monday 1st of January" 'D, m M Y': "Mon, 01 Jan 2014" 'd-m-y': "01-01-14" 'jS M Y': "10th Feb 2014" limit: type: text size: x-small label: Count Limit validate: type: number min: 1 order.dir: type: toggle label: Order Direction highlight: asc default: desc options: asc: Ascending desc: Descending
以下是表格 archive.yaml 中的元素.
切换
enabled: type: toggle label: Plugin status highlight: 1 default: 1 options: 1: Enabled 0: Disabled validate: type: bool
选择
date_display_format: type: select size: medium classes: fancy label: Date Format default: 'jS M Y' options: 'F jS Y': "January 1st 2014" 'l jS of F': "Monday 1st of January" 'D, m M Y': "Mon, 01 Jan 2014" 'd-m-y': "01-01-14" 'jS M Y': "10th Feb 2014"
文字
limit: type: text size: x-small label: Count Limit validate: type: number min: 1
选项为根元素"已启用"," date_display_format"和" limit"。 此根元素中存在的字段确定类型,大小,标签,默认值和选项。 根据字段类型,其他字段可以更改; 例如,选择字段需要选项列表。
Order direction
order.dir: type: toggle label: Order Direction highlight: asc default: desc options: asc: Ascending desc: Descending
该字段由嵌套选项组成。 在plugins / admin / themes / Grav / templates / forms / fields中可以使用许多字段类型。 正如我们在archive.yaml文件中看到的那样,表单验证已设置为strict。 如果将验证设置为严格,则必须为所有选项添加蓝图表单,否则在保存时将弹出错误。 当您只想将两个字段自定义为管理界面时,可以将form.validation设置为松散。
下表简要说明了与上述表单元素有关的字段。
Sr.No. | Field & Description |
---|---|
1 | Type Indicates the field type. |
2 | Size Specifies the size of the field. |
3 | Label Specifies label to the field. |
4 | Validate It validates the type of the field and the minimum length entered in the field. |
5 | Default Sets default fields. |
6 | Options Specifies the list of options. |
7 | Classes Specifies the class for the field. |
插件和主题可以使用许多内置表单字段,也可以创建自己的表单字段。 下表列出了可用的表单字段:
Sr.No. | Field & Description |
---|---|
1 | Checkbox Displays single checkbox. |
2 | Checkboxes Displays a list of checkboxes. |
3 | Date Contains date field. |
4 | Datetime Contains date and time field. |
5 | Contains an email address field with validation. |
6 | Password Contains a password field which displays in dot format. |
7 | Hidden Contains hidden input field. |
8 | Radio Allows selecting only one option from the list. |
9 | Select This field contains few options. |
10 | Spacer Adds title, text or horizontal line to the form. |
11 | Text Contains normal text field. |
12 | Textarea Contains multiline text inputs. |
Sr.No. | Field & Description |
---|---|
1 | Array Adds multiple key value rows. |
2 | Ignore Unused fields are removed. |
3 | Columns Divides the form into multiple columns. |
4 | Column Displays a single column. |
5 | Dateformat Sets the date and time format. |
6 | Display Displays text value without any input value. |
7 | Frontmatter The page is displayed in raw format. |
8 | List Displays a list of items without a key. |
9 | Markdown Displays the markdown editor. |
10 | Pages Displays the list of pages. |
11 | Section The setting page is divided into sections and each section has a title. |
12 | Selectize It is used to select boxes. |
13 | Tabs Settings are divided into list of tabs. |
14 | Tab The tabs field uses to provide a tab. |
15 | Taxonomy It is a select preconfigured to select the taxonomy. |
16 | Toggle It represents the toggle effect that specifies on or off type of input. |