- Description:
This key represents an individual pull request template object in the
pull_request_templatesarray.The value is an object that defines a template for pull requests. Each template can contain
label,title,body,template_path, and_inputskeys.- Appears in:
└── pull_request_templates └── [*]- Type:
Object- Properties:
This key defines the default value of the "Body" field in your Pull Request.
This key has no default.
Show examplesHide examples
In this example, the
bodyfield of our Pull Request template is populated by the string "In this update, I have made the following changes..." by default.Copied to clipboardpull_request_templates: - label: Content Update title: Updates to... body: In this update, I have made the following changes...{ "pull_request_templates": [ { "label": "Content Update", "title": "Updates to...", "body": "In this update, I have made the following changes..." } ] }This key defines which inputs are available at a given level of the configuration cascade.
This key has no default.
If undefined at higher levels of the configuration cascade,
_inputswill default to any values configured in the CloudCannon configuration file.Show examplesHide examples
In this example, we have configured the
date_createdkey as a Date and Time Input, which will automatically populate when you create a file using this input. Editors cannot alter this input as the interface is disabled.Copied to clipboard_inputs: date_created: type: datetime label: Date of article creation comment: UTC +0 timezone context: open: false title: Help icon: help content: This date field will automatically populate when you create an article. hidden: false disabled: true instance_value: NOW cascade: true options: timezone: Etc/UTC{ "_inputs": { "date_created": { "type": "datetime", "label": "Date of article creation", "comment": "UTC +0 timezone", "context": { "open": false, "title": "Help", "icon": "help", "content": "This date field will automatically populate when you create an article." }, "hidden": false, "disabled": true, "instance_value": "NOW", "cascade": true, "options": { "timezone": "Etc/UTC" } } } }In this example, we have configured the
blog_tagskey as a Multiselect Input in theblogCollection.Copied to clipboardcollections_config: blog: _inputs: blog_tags: type: multiselect label: Blog type comment: Select a blog type context: open: false title: Help icon: help content: | Blog tags help our users filter articles by topic. options: values: - Opinion - Feature - Resource{ "collections_config": { "blog": { "_inputs": { "blog_tags": { "type": "multiselect", "label": "Blog type", "comment": "Select a blog type", "context": { "open": false, "title": "Help", "icon": "help", "content": "Blog tags help our users filter articles by topic.\n" }, "options": { "values": [ "Opinion", "Feature", "Resource" ] } } } } } }This key defines the name of a Pull Request template, which appears in the dropdown menu on the Publishing page.
This key has no default.
Show examplesHide examples
In this example, the name of the Pull Request template in the dropdown menu on the Publishing page will be "Content Update".
Copied to clipboardpull_request_templates: - label: Content Update title: Updates to... body: In this update, I have made the following changes...{ "pull_request_templates": [ { "label": "Content Update", "title": "Updates to...", "body": "In this update, I have made the following changes..." } ] }This key defines the path to the file CloudCannon should use as the value of the
bodyfield in a Pull Request template. This file path must be relative to the root of your repository (i.e.,/, not the value ofsource). This allows you to create more complex default content for your Pull Request.CloudCannon will not use the content of this file if the
bodykey is also defined for the Pull Request template.This key has no default.
Show examplesHide examples
In this example, the
bodyfield of our Pull Request template is populated by the contents of.github/templates/delete-content.mdby default.Copied to clipboardpull_request_templates: - label: Delete content title: Delete content _inputs: title: options: disabled: true template_path: .github/templates/delete-content.md{ "pull_request_templates": [ { "label": "Delete content", "title": "Delete content", "_inputs": { "title": { "options": { "disabled": true } } }, "template_path": ".github/templates/delete-content.md" } ] }This key defines the default value of the "Title" field in your Pull Request.
This key has no default.
Show examplesHide examples
In this example, the
titlefield of our Pull Request template is populated by the string "Updates to..." by default.Copied to clipboardpull_request_templates: - label: Content Update title: Updates to... body: In this update, I have made the following changes...{ "pull_request_templates": [ { "label": "Content Update", "title": "Updates to...", "body": "In this update, I have made the following changes..." } ] }- Examples:
In this example, we have configured a Pull Request template with a label, title, body, and input configuration.
Copied to clipboardpull_request_templates: - label: General changes title: Updates to... body: In this update, I have made the following changes... _inputs: title: options: required: true body: type: markdown options: bold: true italic: true link: true format: p h1 h2 h3{ "pull_request_templates": [ { "label": "General changes", "title": "Updates to...", "body": "In this update, I have made the following changes...", "_inputs": { "title": { "options": { "required": true } }, "body": { "type": "markdown", "options": { "bold": true, "italic": true, "link": true, "format": "p h1 h2 h3" } } } } ] }