Skip to main content
Community Plugin
View plugin on GitHub
See starters using this

gatsby-source-yuque

NPM version LICENSE version

Source plugin for pulling data into Gatsby from 语雀 API.

Install

npm install --save gatsby-source-yuque

How to use

// In your gatsby-config.js
plugins: [
  {
    resolve: 'gatsby-source-yuque',
    options: {
      login: 'raincal',
      repo: 'blog',
      mdNameFormat: 'title'
    }
  }
]

Options

Name Default Description
baseUrl https://www.yuque.com/api/v2/ base url
login user/team unique name
repo repo name
mdNameFormat title title or slug
timeout 10000 timeout specifies the number of milliseconds before the request times out

Query for all nodes

{
  allYuqueDoc {
    edges {
      node {
        title
        slug
        cover
        description
        created_at
        childMarkdownRemark {
          html
        }
      }
    }
  }
}

LICENSE

MIT

Docs
Tutorials
Plugins
Blog
Showcase