Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
June 2, 2020 04:20 pm GMT

A Jekyll plugin for Web Monetization

What I built

Inspired by Sabine's post on her Hugo theme component and Daniel's Eleventy plugin I thought I would try to bring Web Monetization to the world of Jekyll.

I create the jekyll-web_monetization gem which aims to make it easy to add payment pointers to Jekyll sites. You can set a site-wide payment pointer, which is great if it is your own site. Or, if you have multiple authors, you can set per-post payment pointers in the the page's YAML front matter.

Submission Category:

Foundational Technology

Demo

I had previously added Web Monetization by hand to my own Jekyll powered site, but as a demo I have replaced the hand rolled solution with my jekyll-web_monetization gem.

Link to Code

You can see all the code and documentation here:

GitHub logo philnash / jekyll-web_monetization

A Jekyll plugin to add Web Monetization API payment pointers to your site

Jekyll::WebMonetization

A Jekyll plugin to add Web Monetization API payment pointers to your site.

Build Status

Web Monetization

A JavaScript browser API which allows the creation of a payment stream from the user agent to the website.

Find out more about Web Monetization.

Payment pointer

To use this plugin and receive payments from Web Monetization you will need a payment pointer. A payment pointer is an address at which you can receive streaming payments from the Web Monetization API. You can set up a payment pointer by creating a digital wallet with one of the providers listed on the Web Monetization API site.

You can read more about payment pointers and receiving money from Web Monetization in the relevant documentation.

Installation

Add the gem to the :jekyll_plugins group in your Jekyll site's Gemfile:

group :jekyll_plugins do  gem 'jekyll-web_monetization'end

Execute:

  $ bundle install

Then in your site's _config.yml add the

How I built it

This is not the first Jekyll plugin I have built, but this is the first time I created a custom liquid tag to be used in a site. There was not a lot of code needed, in fact the hardest part was digging into the config that is passed to a liquid tag as it is rendered in order to extract the information so it could be added to the page.


Original Link: https://dev.to/philnash/a-jekyll-plugin-for-web-monetization-23m4

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To