Link Search Menu Expand Document (external link)

Configuration

Indiekit uses cosmiconfig to find and load a configuration file. Starting from the current working directory, it looks for the following possible sources:

  • a indiekit property in package.json
  • a .indiekitrc file
  • a indiekit.config.js file exporting a JavaScript object
  • a indiekit.config.cjs file exporting a JavaScript object (in projects that specify "type":"module" in package.json)

The search stops when one of these is found, and Indiekit uses that object. You can use the --config CLI option to short-circuit the search.

The .indiekitrc file (without extension) can be in JSON or YAML format. You can add a filename extension to help your text editor provide syntax checking and highlighting:

  • .indiekitrc.json
  • .indiekitrc.yaml / .indiekitrc.yml
  • .indiekitrc.js

The configuration object has the following properties:

application

application.locale string

The language used in the application interface.

Optional, defaults to system language if supported, else "en" (English). For example:

{
  "application": {
    "locale": "de"
  }
}

See Localisation →


application.mongodbUrl URL

To cache files and save information about previously posts and files, you will need to connect Indiekit to a MongoDB database. You can host one on MongoDB Atlas.

Optional, defaults to false. For example:

{
  "application": {
    "mongodbUrl": "mongodb+srv://<USER>:<PASS>@<HOST>/<DATABASE>"
  }
}

Important

This value may contain private information such as a username and password. It’s recommended that you store this value in an environment (or configuration) variable which can only be seen by you and the application.


application.name string

The name of your server.

Optional, defaults to "Indiekit". For example:

{
  "application": {
    "name": "My IndieWeb Server"
  }
}

application.themeColor string

Accent colour used in the application interface.

Optional, defaults to "#0055ee". For example:

{
  "application": {
    "themeColor": "#663399"
  }
}

application.themeColorScheme string

Color scheme used in the application interface, "automatic", "light" or "dark".

Optional, defaults to "automatic". For example:

{
  "application": {
    "themeColorScheme": "dark"
  }
}

application.ttl number

Length of time to cache external data requests (in seconds).

Optional, defaults to 604800 (7 days). For example:

{
  "application": {
    "ttl": 3600
  }
}

application.url string

The URL of your server. Useful if Indiekit is running behind a reverse proxy.

Optional, defaults to the URL of your server (as provided by request headers). For example:

{
  "application": {
    "url": "https://server.website.example"
  }
}

plugins

An array of plug-ins you wish to use with Indiekit. For example:

{
  "plugins": [
    "@indiekit/preset-jekyll",
    "@indiekit/store-github",
    "@indiekit/syndicator-mastodon",
    "@indiekit/syndicator-twitter",
  ],
}

Each plug-in may accept its own configuration options, and these should be provided under a key with the plug-in’s name. For example:

{
  "@indiekit/preset-hugo": {
    "frontMatterFormat": "yaml"
  }
}

Learn more about Indiekit’s plug-in API.


publication

publication.authorizationEndpoint URL

Authorisation endpoint.

Optional, defaults to "https://indieauth.com/auth". For example:

{
  "publication": {
    "authorizationEndpoint": "https://example.org/auth"
  }
}

publication.categories Array | URL

A list of categories or tags used on your website. Can be an array of values, or the location of a JSON file providing an array of values.

Optional.

Example, using an array:

{
  "publication": {
    "categories": ["sport", "technology", "travel"]
  }
}

Example, using a URL:

{
  "publication": {
    "categories": "https://website.example/categories.json"
  }
}

publication.locale string

Your publication’s locale. Currently used to format dates.

Optional, defaults to "en" (English). For example:

{
  "publication": {
    "locale": "de"
  }
}

publication.me URL

Your website’s URL.

Required. For example:

{
  "publication": {
    "me": "https://website.example"
  }
}

publication.mediaEndpoint URL

Indiekit provides a media endpoint, but you can use a third-party endpoint by setting a value for this option.

Optional. For example:

{
  "publication": {
    "mediaEndpoint": "https://media.website.example"
  }
}

publication.postTemplate Function

A post template is a function that takes post properties received and parsed by the Micropub endpoint and renders them in a given file format, for example, a Markdown file with YAML front matter.

Optional, defaults to MF2 JSON. For example:

// indiekit.config.cjs
import { myPostTemplate } from "./my-post-template.js";

export default {
  publication: {
    postTemplate: myPostTemplate,
  },
};

Note

This option is only available for configuration files that export a JavaScript object (for example, indiekit.config.js or indiekit.config.cjs).

See customising a post template →


publication.postTypes Array

A set of default paths and templates for different post types.

Optional if using a preset. For example:

"publication": {
  "postTypes": [{
    "type": "note",
    "name": "Journal entry",
    "post": {
      "path": "_journal/{yyyy}-{MM}-{dd}-{slug}.md",
      "url": "journal/{yyyy}/{MM}/{slug}"
    }
  }]
}

See customising post types →


publication.slugSeparator string

The character used to replace spaces when creating a slug.

Optional, defaults to "-" (hyphen). For example:

{
  "publication": {
    "slugSeparator": "_"
  }
}

publication.storeMessageTemplate Function

Function used to customise message format.

Optional, defaults to [action] [postType] [fileType]. For example:

export default {
  publication: {
    storeMessageTemplate: (metaData) =>
      `🤖 ${metaData.result} a ${metaData.postType} ${metaData.fileType}`,
  },
};

Note

This option is only available for configuration files that export a JavaScript object (for example, indiekit.config.js or indiekit.config.cjs).

See customising commit messages →


publication.timeZone string

The time zone for your publication. By default this is set to "UTC", however if you want to offset dates according to your time zone you can provide a time zone name. This option also accepts a number of other values.

Optional, defaults to "UTC". For example:

{
  "publication": {
    "timeZone": "Europe/Berlin"
  }
}

See customising the time zone →


publication.tokenEndpoint URL

An IndieAuth token endpoint.

Optional, defaults to "[application.url]/token". For example:

{
  "publication": {
    "tokenEndpoint": "https://server.website.example/token"
  }
}