Configuration Options

Configuration Options for stapsher.yaml

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

EncryptedString

Encrypted Akismet API Key

akismet.enable

Boolean

If true, entries will be checked via Akismet for spam

Default: false

akismet.fields.author

String

Field name for the entry Author’s Name

Default: author

akismet.fields.authorEmail

String

Field name for the entry Author’s Email

Default: email

akismet.fields.authorUrl

String

Field name for the entry Author’s URL

Example: site

Default: url

akismet.fields.content

String

Field name for the entry Content

Example: comment

Default: content

akismet.siteUrl

String

Site URL form the Akismet account

Example: https://extrastatic.xyz

akismet.type

String

Type of the entry

Default: comment

allowedFields

Array

An 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

String

Name of the repository branch being used

Default: master

commitMessage

String

Commit message for entries pushed to the repository (Placeholders allowed)

Example: add new comment by {fields.author} <Stapsher>

Default: add data <Stapsher>

extension

String

Extension for the data files being pushed to the repository. If empty, it fallbacks to the format option

Example: yaml

filename

String

Name for the data files being pushed to the repository (Placeholders allowed)

Example: {_date~unix}.{_id}

Default: {_id}

format

json / yaml / yml

Format of the data files being pushed to the repository

Example: yaml

Default: json

generatedFields

Object

List of fields to be appended to entries automatically

Example:

timestamp:
  type: date
  options:
    format: unix

moderation

Boolean

If 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

String

Path to the directory where data files will be stored (Placeholders allowed)

Example: data/comments

Default: data/stapsher

pullRequestBody

String

Text 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

Boolean

If true, reCAPTCHA validation will be required

Default: false

recaptcha.secretKey

EncryptedString

Encrypted Secret Key for reCAPTCHA

requiredFields

Array

An 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

Object

List of transformations to be applied to the fields

Example:

email: hash~md5