jekyll-web_monetization 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.editorconfig +13 -0
- data/.github/workflows/tests.yml +25 -0
- data/.gitignore +7 -1
- data/CHANGELOG.md +8 -1
- data/Gemfile +3 -0
- data/README.md +1 -1
- data/lib/jekyll/web_monetization/tag.rb +16 -7
- data/lib/jekyll/web_monetization/version.rb +1 -1
- data/lib/jekyll/web_monetization.rb +1 -1
- metadata +8 -7
- data/.travis.yml +0 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cb404e9e9e1084c07cf05d07d9e967c99754bd01dbfdb116f946b707b452435a
|
4
|
+
data.tar.gz: f5a6eb905cea2c627182a30394bb3836179c8b38d5b4b30b548a2f6266f4d280
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 48be3b374d73a1e6ce9a5149781f9346272d87ffa282e18b2bf52f7d1e8d4d08d511c095c349f20ff279178692adbdce0dabb800b4b552bd237d46eb310e849c
|
7
|
+
data.tar.gz: 2c10b5c4cd28b61508903ef1c31d33623c7bd58d3efd8db3605ef3db69b5359f394c17e3aa1d10294a6b16be5f2c64df86cf120c4dea99ce79f34f80d0187808
|
data/.editorconfig
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
name: tests
|
2
|
+
|
3
|
+
on: [push, pull_request]
|
4
|
+
|
5
|
+
jobs:
|
6
|
+
test:
|
7
|
+
runs-on: ubuntu-latest
|
8
|
+
strategy:
|
9
|
+
fail-fast: false
|
10
|
+
matrix:
|
11
|
+
ruby: [2.5, 2.6, 2.7, "3.0", 3.1, head]
|
12
|
+
jekyll: ["~> 4.0", "~> 3.0"]
|
13
|
+
continue-on-error: ${{ endsWith(matrix.ruby, 'head') }}
|
14
|
+
env:
|
15
|
+
JEKYLL_VERSION: ${{ matrix.jekyll }}
|
16
|
+
steps:
|
17
|
+
- uses: actions/checkout@v2
|
18
|
+
- name: Set up Ruby ${{ matrix.ruby }}
|
19
|
+
uses: ruby/setup-ruby@v1
|
20
|
+
with:
|
21
|
+
ruby-version: ${{ matrix.ruby }}
|
22
|
+
- name: "Install dependencies (Jekyll: ${{matrix.jekyll}})"
|
23
|
+
run: bundle install
|
24
|
+
- name: Run tests
|
25
|
+
run: bundle exec rspec
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,9 +1,16 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
-
## Ongoing [☰](https://github.com/philnash/jekyll-brotli/compare/
|
3
|
+
## Ongoing [☰](https://github.com/philnash/jekyll-brotli/compare/v0.2.1...master)
|
4
4
|
|
5
5
|
...
|
6
6
|
|
7
|
+
## 0.2.1 (2022-04-05) [☰](https://github.com/philnash/jekyll-web_monetization/compare/v0.2.0...v0.2.1)
|
8
|
+
|
9
|
+
### Added
|
10
|
+
|
11
|
+
- If the config is set to an array of payment pointers that has only one payment pointer, then just print the meta tag ([Thanks SethFalco](https://github.com/philnash/jekyll-web_monetization/pull/1))
|
12
|
+
|
13
|
+
|
7
14
|
## 0.2.0 (2020-06-08) [☰](https://github.com/philnash/jekyll-web_monetization/compare/v0.1.0...v0.2.0)
|
8
15
|
|
9
16
|
### Added
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
A Jekyll plugin to add [Web Monetization API](https://webmonetization.org/) payment pointers to your site.
|
4
4
|
|
5
|
-
[![Build
|
5
|
+
[![Gem Version](https://badge.fury.io/rb/jekyll-web_monetization.svg)](https://badge.fury.io/rb/jekyll-web_monetization) ![Build status](https://github.com/philnash/jekyll-web_monetization/workflows/tests/badge.svg) [![Maintainability](https://api.codeclimate.com/v1/badges/9a29d485942538c525dc/maintainability)](https://codeclimate.com/github/philnash/jekyll-web_monetization/maintainability) [![Inline docs](http://inch-ci.org/github/philnash/jekyll-web_monetization.svg?branch=master)](http://inch-ci.org/github/philnash/jekyll-web_monetization)
|
6
6
|
|
7
7
|
## Web Monetization
|
8
8
|
|
@@ -7,18 +7,27 @@ module Jekyll
|
|
7
7
|
def render(context)
|
8
8
|
site_payment_pointer = context.registers[:site].config["payment_pointer"]
|
9
9
|
page_payment_pointer = context.registers[:page]["payment_pointer"] || site_payment_pointer
|
10
|
-
|
11
|
-
|
12
|
-
|
10
|
+
|
11
|
+
if page_payment_pointer.is_a?(Array)
|
12
|
+
if page_payment_pointer.length == 1
|
13
|
+
pointer_to_html(page_payment_pointer[0])
|
14
|
+
else
|
15
|
+
pointers_with_weights = array_to_object(page_payment_pointer)
|
16
|
+
return javascript(pointers_with_weights)
|
17
|
+
end
|
13
18
|
elsif page_payment_pointer.is_a?(Hash)
|
14
19
|
return javascript(page_payment_pointer)
|
15
20
|
elsif page_payment_pointer.is_a?(String)
|
16
|
-
|
21
|
+
pointer_to_html(page_payment_pointer)
|
17
22
|
end
|
18
23
|
end
|
19
24
|
|
20
25
|
private
|
21
26
|
|
27
|
+
def pointer_to_html(pointer)
|
28
|
+
return "<meta name='monetization' content='#{pointer}'>"
|
29
|
+
end
|
30
|
+
|
22
31
|
def array_to_object(pointers)
|
23
32
|
pointers.reduce({}) { |acc, pointer| acc[pointer] = 1; acc }
|
24
33
|
end
|
@@ -38,7 +47,7 @@ module Jekyll
|
|
38
47
|
}
|
39
48
|
}
|
40
49
|
}
|
41
|
-
|
50
|
+
|
42
51
|
window.addEventListener("load", function() {
|
43
52
|
const tag = document.createElement("meta");
|
44
53
|
tag.name = "monetization";
|
@@ -48,7 +57,7 @@ module Jekyll
|
|
48
57
|
})();
|
49
58
|
</script>
|
50
59
|
JAVASCRIPT
|
51
|
-
end
|
60
|
+
end
|
52
61
|
end
|
53
62
|
end
|
54
|
-
end
|
63
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-web_monetization
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Phil Nash
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-04-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -66,9 +66,10 @@ executables: []
|
|
66
66
|
extensions: []
|
67
67
|
extra_rdoc_files: []
|
68
68
|
files:
|
69
|
+
- ".editorconfig"
|
70
|
+
- ".github/workflows/tests.yml"
|
69
71
|
- ".gitignore"
|
70
72
|
- ".rspec"
|
71
|
-
- ".travis.yml"
|
72
73
|
- CHANGELOG.md
|
73
74
|
- CODE_OF_CONDUCT.md
|
74
75
|
- Gemfile
|
@@ -88,7 +89,7 @@ metadata:
|
|
88
89
|
homepage_uri: https://github.com/philnash/jekyll-web_monetization
|
89
90
|
source_code_uri: https://github.com/philnash/jekyll-web_monetization
|
90
91
|
changelog_uri: https://github.com/philnash/jekyll-web_monetization/master/CHANGELOG.md
|
91
|
-
post_install_message:
|
92
|
+
post_install_message:
|
92
93
|
rdoc_options: []
|
93
94
|
require_paths:
|
94
95
|
- lib
|
@@ -103,8 +104,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
103
104
|
- !ruby/object:Gem::Version
|
104
105
|
version: '0'
|
105
106
|
requirements: []
|
106
|
-
rubygems_version: 3.
|
107
|
-
signing_key:
|
107
|
+
rubygems_version: 3.3.3
|
108
|
+
signing_key:
|
108
109
|
specification_version: 4
|
109
110
|
summary: A Jekyll plugin to add Web Monetization API payment pointers to your site
|
110
111
|
test_files: []
|
data/.travis.yml
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
---
|
2
|
-
sudo: false
|
3
|
-
language: ruby
|
4
|
-
cache: bundler
|
5
|
-
rvm:
|
6
|
-
- 2.7
|
7
|
-
- 2.6
|
8
|
-
- 2.5
|
9
|
-
- 2.4
|
10
|
-
- ruby-head
|
11
|
-
env:
|
12
|
-
- 'JEKYLL_VERSION="~> 3.0"'
|
13
|
-
- 'JEKYLL_VERSION="~> 4.0"'
|
14
|
-
matrix:
|
15
|
-
allow_failures:
|
16
|
-
- rvm: ruby-head
|
17
|
-
before_install: gem install bundler
|
18
|
-
script: bundle exec rspec
|