Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gatsby-tinacms-git

Package Overview
Dependencies
Maintainers
12
Versions
217
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gatsby-tinacms-git

A Gatsby/Tina plugin for **editing content/data files stored in git**.

  • 0.43.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
12
Created
Source

gatsby-tinacms-git

A Gatsby/Tina plugin for editing content/data files stored in git.

Installation

yarn add gatsby-plugin-tinacms gatsby-tinacms-git

Setup

Include gatsby-plugin-tinacms and gatsby-tinacms-gitin your config:

gatsby-config.js

module.exports = {
  // ...
  plugins: [
    // ...
    {
      resolve: 'gatsby-plugin-tinacms',
      options: {
        plugins: ['gatsby-tinacms-git'],
      },
    },
  ],
}

Options

// reference @tinacms/api-git

interface GitServerConfig extends GitRouterConfig {
  pathToRepo: string
  pathToContent: string
  gitRemote?: string
  sshKey?: string
}

interface GitRouterConfig {
  defaultCommitMessage: string
  defaultCommitName: string
  defaultCommitEmail: string
  pushOnCommit: boolean
}

const DEFAULT_OPTIONS: GitRouterConfig = {
  defaultCommitMessage: 'Edited with TinaCMS',
  defaultCommitName: 'TinaCMS',
  defaultCommitEmail: 'git@tinacms.org',
  pushOnCommit: true,
}
OptionDescription
pathToRepoThe base-path to the repository where the content is stored in. Default: The repository root.
pathToContentThe directory to the root of your app within the repository. Default: The repository root. This can be useful for monorepos, when you have multiple sites within one repository.
defaultCommitMessageThe default commit message. Default: 'Edited with TinaCMS'
defaultCommitNameThe default Git user name.
defaultCommitEmailThe default Git user email.
pushOnCommitIndicates if every commit should also be pushed automatically. Default: true.
gitRemoteGit SSH remote url for the repository. Default: undefined.
sshKeyBase64 encoded SSH private key that has access to the repository. This should not be committed to your repository. This value should be undefined or load the key from an environment variable (ie. process.env.SSH_KEY). Default: undefined.

Configuring the File Writing Debounce

The TINA_GIT_DEBOUNCE_MS environment variable can be used to change the debounce rate for file writing. This value defaults to 1000 milliseconds.

TINA_GIT_DEBOUNCE_MS=3000 gatsby develop

This is useful when running in your site in cloud editing environment i.e. Gatsby Cloud or Heroku.

Keywords

FAQs

Package last updated on 23 Jul 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc