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

hexo-plugin-schnack

v1.0.2

Published

Plugin for adding the Schnack comment system to your Hexo Blog.

Downloads

7

Readme

Plugin for adding the Schnack comment system to your Hexo Blog.

🏠 Homepage

Demo

Installation

  1. Enter your blog folder and install the plugin: yarn add hexo-plugin-schnack

  2. Add <div class="schnack"></div> in the location you want your comments to show in theme/<your theme>/layout/_partials/article.js (usually will be under article-footer if you want comments to show under your posts). I would recommend wrapping it with <% if (config.schnack.enable){ %> and <% } %> so that you can easily disable in the future if needed.

  3. Add the schnack, create-schnack, and jst libraries: yarn add schnack create-schnack jst

  4. Create a basic schnack.json config file using the create-schnack helper library, making sure you say y to the first question and answering each question to the best of your ability: yarn exec create-schnack

Important

When you arrive at the plugins question, there is a bug where all plugins are checkmarked but won't install or configure correctly. Use the arrow keys to select the ones you wanna install and then hit the spacebar to select. You can always manually add more later but at least one OAUTH and notification one are required. All plugins are named @schnack/plugin-<plugin name>. See guide in next step for more info.

  1. Configure the rest following the configuration guide. You may want to set your comments.db and session.db files to a directory outside of your blog folder if you're using version control or add them to a .gitignore file. They will constantly be updating as your blog grows and you may not want to version control them.

Important

  • page_url needs to be <your blog url>/%SLUG%
  • If you're running your site through a reverse proxy such as CloudFlare, you may have to use http instead of https for your urls. A possible workaround is downloading both your certificate and key files to a directory on the server that's outside of your blog folder and then telling schnack where to find them using the ssl configuration option.
  1. Test your config: yarn exec schnack start. If all goes well, it shouldn't crash or error out.

  2. Enable and configure schnack in your _config.yml file:

schnack:
  enable: true
  host: <full url of your Schnack instance>

Advanced configuration options:

schnack:
  slug: <probably won't need to change this>
  partials: <these are all strings and change what language/text is shown for every aspect of the web client; most should be self-explanatory>
    preview:
    edit:
    sendComment:
    cancel:
    or: <not sure what this is for>
    mute:
    unmute:
    postComment:
    adminApproval: <if moderation is on, this is what is shown to you when a new comment appears>
    waitingForApproval: <same thing but for your readers>
    signInVia: <readers must be authenticated through any service you set up and will get this warning message>
    reply:
    loginStatus:

If you ever want to use the defaults or start over, just remove or comment out anything under partials.

Optional but Recommended Steps

  1. Globally install the pm2 process manager and pm2-logrotate so you can monitor, run and keep local logs of schnack quickly and easily: yarn global add pm2 pm2-logrotate. Lograte's defaults are pretty sane but if you need to further tweak them, check here.

All logs can be found under ~/.pm2/logs and they are named well enough that you should be able to figure them out if you run into issues.

  1. Add yarn exec schnack start to your package.json:
"scripts": {
    ...
    "chat": "yarn exec schnack start"
    ...
}
  1. Start schnack and monitor it with pm2: pm2 start --name "<blog name> Schnack" 'yarn chat' && pm2 monit

  2. If everything's working as intended, the logs shouldn't show any errors and the process should show that it's using memory. Hit Q to exit.

  3. Add pm2 to system startup: pm2 save && pm2 startup. It should print out a message telling you to use a command to add pm2 to your init system. Run it and you should be good to go.

Author

👤 Brandon D

🤝 Contributing

Contributions, issues, feature requests and feedback are welcome!Feel free to check issues page for plugin related ones or schnack for the rest.

Show your support

Give a ⭐️ if this project helped you!u!

📝 License

Copyright © 2022 Brandon D . This project is MIT licensed.


This README was generated with ❤️ by readme-md-generator