Nerds Publishing Monstrosities
    Have ideas to improve npm?Join in the discussion! »

    gatsby-source-hashnode

    1.0.1 • Public • Published

    gatsby-source-hashnode

    npm npm npm license

    Gatsby source plugin for building websites using Hashnode as data source.

    Install

    npm install gatsby-source-hashnode

    How to use

    Configure the plugin in gatsby-config.js:

    // gatsby-config.js
    module.exports = {
        plugins: [
            {
                resolve: "gatsby-source-hashnode",
                options: {
                    username: "<HASHNODE_USERNAME>",
                },
            },
        ]
    }

    How to query

    Get user posts

    {
        allHashNodePost {
            edges {
                node {
                    brief       # "In this article..."
                    coverImage  # "http://..."
                    slug        # "my-great-article"
                    title       # "My Great Article"
                }
            }
        }
    }

    Get post's reading time

    (With the kind help of reading-time)

    {
        allHashNodePost {
            edges {
                node {
                    title
                    readingTime {
                        minutes    # 2
                        text       # "2 min read"
                        time       # 120000
                        words      # 100
                    }
                }
            }
        }
    }

    Get user details

    {
        allHashNodeUser {
            edges {
                node {
                    _id
                    blogHandle         # "userhandle1"
                    coverImage         # "https:/...
                    dateJoined         # "2014-01-01T01:00:00.000Z"
                    isDeactivated      # false
                    isEvangelist       # true
                    location           # "Canada"
                    name               # "First last"
                    numFollowers       # 503
                    numFollowing       # 14
                    numPosts           # 50
                    numReactions       # 95
                    photo              # "https:/...
                    publicationDomain  # "blog.mydomain.."
                    tagline            # "I do stuff"
                    username           # "username1"
                }
            }
        }
    }

    Install

    npm i gatsby-source-hashnode

    DownloadsWeekly Downloads

    10

    Version

    1.0.1

    License

    MIT

    Unpacked Size

    10.1 kB

    Total Files

    9

    Last publish

    Collaborators

    • avatar