Stapsher’s configuration file must be named stapsher.yaml and stored in the root directory of your git repository.
The root key should define the entryType. And all the other options goes under it.
Example:
comment:
akismet:
enable: false
...You can have multiple entryType blocks in the stapsher.yaml file.
Here are the available options:
akismet.apiKey
EncryptedStringEncrypted Akismet API Key
akismet.enable
BooleanIf true, entries will be checked via Akismet for spam
Default: false
akismet.fields.author
StringField name for the entry Author’s Name
Default: author
akismet.fields.authorEmail
StringField name for the entry Author’s Email
Default: email
akismet.fields.authorUrl
StringField name for the entry Author’s URL
Example: site
Default: url
akismet.fields.content
StringField name for the entry Content
Example: comment
Default: content
akismet.siteUrl
StringSite URL form the Akismet account
Example: https://extrastatic.xyz
akismet.type
StringType of the entry
Default: comment
allowedFields
ArrayAn array with the names of the allowed fields. If any of the fields sent is not in this list, the entry will be discarded and an error will be thrown.
Example: ["author","email","comment","site"]
Default: []
branch
StringName of the repository branch being used
Default: master
commitMessage
StringCommit message for entries pushed to the repository (Placeholders allowed)
Example: add new comment by {fields.author} <Stapsher>
Default: add data <Stapsher>
extension
StringExtension for the data files being pushed to the repository. If empty, it fallbacks to the format option
Example: yaml
filename
StringName for the data files being pushed to the repository (Placeholders allowed)
Example: {_date~unix}.{_id}
Default: {_id}
format
json / yaml / ymlFormat of the data files being pushed to the repository
Example: yaml
Default: json
generatedFields
ObjectList of fields to be appended to entries automatically
Example:
timestamp:
type: date
options:
format: unixmoderation
BooleanIf true, a pull request with the data files will be created on the repository. Otherwise, data files will be pushed to branch directly.
Default: false
path
StringPath to the directory where data files will be stored (Placeholders allowed)
Example: data/comments
Default: data/stapsher
pullRequestBody
StringText to be used as the Pull Request Body when moderation is enabled
Default:
Hey there, Here's a new entry for your approval! :tada: Merge the pull request to accept it or close to get rid of it. — [Stapsher](https://stapsher.extrastatic.xyz) :rocket: ---
recaptcha.enable
BooleanIf true, reCAPTCHA validation will be required
Default: false
recaptcha.secretKey
EncryptedStringEncrypted Secret Key for reCAPTCHA
requiredFields
ArrayAn array with the names of the fields that are required for an entry. If any of these fields are absent, the entry will be discarded and an error will be thrown.
Example: ["author","comment","email"]
Default: []
transforms
ObjectList of transformations to be applied to the fields
Example:
email: hash~md5