npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

gatsby-plugin-valine-comment

v1.1.0

Published

Yet another Gatsby plugin for Valine comment system

Downloads

31

Readme

gatsby-plugin-valine-comment

npm version

Yet another Gatsby plugin for Valine comment system.

中文文档

✨ Features

This plugin help you use Valine comment system more easy in your website.

  • Pure wrapping of the latest Valine with React Hooks API
  • Support all options of Valine
  • Written in TypeScript

🚚 Installation

npm install gatsby-plugin-valine-comment

or

yarn add gatsby-plugin-valine-comment

This plugin requires React v16.8 or above.

🔦 Usage

  1. If you don't have AppId and AppKey of LeanCloud, check this document here

  2. Enable the plugin in your gatsby-config.js

    // In your gatsby-config.js
    plugins: [
        {
            resolve: `gatsby-plugin-valine-comment`,
            options: {
                // plugin options here
                appId: 'LEANCLOUD_APP_ID',
                appKey: 'LEANCLOUD_APP_KEY',
            },
        },
    ];
  3. Use <Valine /> component in your page code

    import React from 'react';
    import Valine from 'gatsby-plugin-valine-comment';
    
    export default function Page({location}) {
        return (
            <Layout>
                <Valine path={location.pathname} /*component options here*/ />
            </Layout>
        );
    }

    Plugin options and component options are same. You can put common options (e.g. appId, appKey, avatar) in plugin options, some options (e.g. path) that you want to set separately for certain pages can be placed in component options. The options will be merged and the options from the component will have higher priority.

After that, you should be able to add and see comments on your website.

🔧 Options

| Name | Type | Default | Description | | -------------- | --------- | ---------------------------------- | -------------------------------------------------------- | | appId | string | null | Application appId from Leancloud | | appKey | string | null | Application appKey from Leancloud | | placeholder | string | Just go go | Comment box placeholders | | path | string | window.location.pathname | Article path(just like duoshuo thread) | | pure | boolean | false | If true, plugin will build valine without default styles | | avatar | string | mp | Avatar, https://valine.js.org/en/avatar.html | | meta | array | ['nick','mail','link'] | Reviewer attributes | | pageSize | bumber | 10 | Number of pages per page | | lang | string | zh-CN | Multilingual support | | langMode | object | null | Custom language, https://valine.js.org/en/i18n.html | | visitor | boolean | false | Article reading statistics | | highlight | boolean | true | Code highlighting | | avatarForce | boolean | false | Each time you access forced pulls the latest avatar | | recordIP | boolean | false | Record reviewer IP | | serverURLs | string | http[s]://[tab/us].avoscloud.com | For domestic custom domain name users | | emojiCDN | string | | Emoji Pack CDN, https://valine.js.org/en/emoji.html | | emojiMaps | object | null | Emoji Packet Mapping | | enableQQ | boolean | false | Whether to automatically get QQ Nickname and QQ Avatar | | requiredFields | array | [] | Set required fields, default anonymous |

For more detail, see https://valine.js.org/en/configuration.html

💡 Why I write this plugin

  • Existing plugins are obsolete and no longer maintained
  • For fun