Git Product home page Git Product logo

gridsome-source-google-docs's Introduction

Gridsome Source for Google Docs

Source plugin for fetching data into Gridsome from Google Docs.

Install

npm install --save gridsome-source-google-docs

Turn on the Google Docs API and set configuration

  • Follow the Step 1: Turn ON the Google Docs API
  • Turn ON the Google Drive API
  • Get a Client ID and a Client Secret from the Google console. If you downloaded credential.json file, you can extract them from it
  • Get an API key from the Google console
  • Fill the gridsome-source-google-docs gridsome options object.

More info can be found on the official Google Docs quickstart guide.

Generate a token file

Run gridsome develop and follow the instructions to generate a token file.

tokenPath can be customized in the options object to change the location and name.

How to use

// In your gridsome.config.js
plugins: [
  {
    use: 'gridsome-source-google-docs',
    options: {
      foldersIds: ['a8o3d384gdjbvxlfdi8rsz3'],
      clientId: '534534534553-sdify73yriw3sy3ri7y33fis73yfis.apps.googleusercontent.com',
      clientSecret: 'fsidufhsie734fhsi7si3',
      apiKey: 'asdas7ir3irshek8hsduska3udhsdu',
    },
  }
]

How to query and filter

You can query the nodes created from Google Drive with the following:

query IndexQuery {
  posts: allGoogleDocs {
    edges {
      node {
        date
        title
        body
        slug
        id
        content
      }
    }
  }
}

gridsome-source-google-docs's People

Contributors

loke-dev avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.