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-theme-ghost-members

v2.0.0

Published

Gatsby theme to easily add a members form to gatsby-theme-try-ghost

Downloads

71

Readme

gatsby-theme-ghost-members

Released under MIT license. gatsby-theme-ghost-members npm package version. PRs welcome!

Adds a membership subscription button and form to gatsby-theme-try-ghost. This plugin interacts directly with your headless Ghost CMS. After a user submits an email address via the subscription form, the user receives a magic link for membership activation in the inbox. If that link is clicked, the user is registered as a member in your Ghost CMS dashboard.

Install

yarn add gatsby-theme-ghost-members

Dependencies

This theme is an add-on theme designed to seamlessly integrate with gatsby-theme-try-ghost. The theme uses functions provided by gatsby-theme-try-ghost, so installing gatsby-theme-try-ghost is required.

yarn add gatsby-theme-try-ghost

How to use

// In your gatsby-config.js
plugins: [
    {
        resolve: `gatsby-theme-ghost-members`,
    },
]

Details

This plugin brings Ghost Membership functionality to your Gatsby site!✨ It utilizes your headless Ghost CMS for managing your members, so there is no need to install another back-end.

A subscription button is added to every page which opens a modal page with a subscription form. In addition, a subscription section is shown at the end of every post with an email input field and a submit button. Once a user submits an email, a POST request is issued to your headless Ghost CMS containing the email as payload. This triggers your CMS to send out an email to that address containing a magic link for membership subscription. Once a user clicks on that link, the user's email address is added to your Ghost membership dashboard.

A final request from Ghost CMS is fired which opens your Ghost site and displays a success message. As this request also points to your CMS, you should use your reverse proxy to forward it to your static site. That way, the user will see the success message where it belongs: on the same website where membership subscription was initiated.

Ghost CMS configuration

You must activate the members dashboard in Ghost Admin. Go to Labs and activate the Enable members section. In addition, ensure that the email configuration is set up correctly. You can test that by clicking on the Send button under Labs -> Test email configuration.

Nginx Configuration (optional)

It is strongly recommended to make a small configuration change to your reverse proxy. With this, the user will be redirected to your Gatsby site after clicking on the magic link:

// /etc/nginx/conf.d/cms-ghost.conf

server {

    server_name cms.your-backend.com;

    if ($args ~* "^action=subscribe&success=") {
        return 301 \$scheme://www.gatsby-frontend.com\$request_uri;
    }
}

Substitute www.gatsby-frontend.com with the address of your static site. Without this change users may get confused: After clicking the magic link, they will see the private login screen of your CMS.

Contributions

PRs are welcome! Consider contributing to this project if you are missing feature that is also useful for others. Explore this guide, to get some more ideas.

Copyright & License

Copyright (c) 2020 styxlab - Released under the MIT license.