Skip to content

A Gatsby source plugin for fetching user toots from Mastodon

License

Notifications You must be signed in to change notification settings

hbish/gatsby-source-mastodon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gatsby-source-mastodon

gatsby-source-mastodon logo

A Gatsby source plugin for fetching user toots from Mastodon.

Currently only support a user's own toots.

Usage

You will need to create an Application with read permission from your Mastodon instance (e.g. https://aus.social/settings/applications).

Add the following block of configuration into your gatsby-config.js. Replace fields surrounded by *** with the correct details.

module.exports = {
  plugins: [
    {
      resolve: 'gatsby-source-mastodon',
      options: {
        // The api url of your mastodon instance (e.g https://aus.social/api/v1)
        api_url: '***MASTODON_INSTANCE_API_URL***',
        // Number of toots to return
        limit: 25,
        // Access token for your Mastodon application
        access_token: '***MASTODON_ACCESS_TOKEN***',
      },
  ],
}

Query Mastodon Data

A sample of the query is included below, for all available field please check the graphl browser.

{
  allToot {
    edges {
      node {
        id
        url
        content
        reblogs_count
        favourites_count
        account {
          username
        }
      }
    }
  }
}

About

A Gatsby source plugin for fetching user toots from Mastodon

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published