bridgetown-plausible 1.0.1 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +16 -0
- data/README.md +10 -2
- data/Rakefile +1 -1
- data/bridgetown-plausible.gemspec +2 -2
- data/bridgetown.automation.rb +19 -8
- data/demo/Gemfile +1 -1
- data/demo/bridgetown.config.yml +9 -1
- data/demo/plugins/site_builder.rb +0 -1
- data/lib/bridgetown-plausible/builder.rb +7 -6
- data/lib/bridgetown-plausible/version.rb +1 -1
- metadata +10 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ef9d4b3c76fedec78de06f8b46a922c9012cacf3ce84c28110adf96e9057e615
|
4
|
+
data.tar.gz: 043260ff038a709878448323b6d3c94460398fb1d15d99d7b68579f85bda2c25
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c3759ae9fe192e9eb781c177b46e8a5a63168d44f0165d0b4046b8d2146c1646d78afefd9d8b7dbac2114fc904c9035573451bb96f6e92fc0a3ae2cb6f00706a
|
7
|
+
data.tar.gz: c6583e55413b8a4321a3b9f703d0fef1c52fc64cf1694d88fe71ed79efd06f7e35fd66b28c3ea6a7781acfc43622500c5bc09b63ea9d5faf381652b89fb77640
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,21 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [1.1.0](https://www.github.com/bt-rb/bridgetown-plausible/compare/v1.0.2...v1.1.0) (2022-09-22)
|
4
|
+
|
5
|
+
|
6
|
+
### Features
|
7
|
+
|
8
|
+
* make server configurable ([#11](https://www.github.com/bt-rb/bridgetown-plausible/issues/11)) ([5c5cd29](https://www.github.com/bt-rb/bridgetown-plausible/commit/5c5cd296477bee6eb6ce38e32051968291995d44))
|
9
|
+
|
10
|
+
### [1.0.2](https://www.github.com/bt-rb/bridgetown-plausible/compare/v1.0.1...v1.0.2) (2021-12-22)
|
11
|
+
|
12
|
+
|
13
|
+
### Bug Fixes
|
14
|
+
|
15
|
+
* use correct link to repo in gemspec and render safe html ([#9](https://www.github.com/bt-rb/bridgetown-plausible/issues/9)) ([02e61b9](https://www.github.com/bt-rb/bridgetown-plausible/commit/02e61b9930240c3b2810627da1e4b357c7563b33))
|
16
|
+
* use correct package name in automation ([#10](https://www.github.com/bt-rb/bridgetown-plausible/issues/10)) ([82eb300](https://www.github.com/bt-rb/bridgetown-plausible/commit/82eb3002ce83d822cab96cbe722c1516635fa8dc))
|
17
|
+
* use the correct url for the automation in our readme docs ([b2b5961](https://www.github.com/bt-rb/bridgetown-plausible/commit/b2b596132b4452d93cfca8e6227c82d766a8691d))
|
18
|
+
|
3
19
|
### [1.0.1](https://www.github.com/bt-rb/bridgetown-plausible/compare/v1.0.0...v1.0.1) (2021-02-06)
|
4
20
|
|
5
21
|
|
data/README.md
CHANGED
@@ -35,7 +35,7 @@
|
|
35
35
|
Use the automation to add to your site:
|
36
36
|
|
37
37
|
```sh
|
38
|
-
bundle exec bridgetown apply https://github.com/
|
38
|
+
bundle exec bridgetown apply https://github.com/bt-rb/bridgetown-plausible
|
39
39
|
```
|
40
40
|
|
41
41
|
## System requirements
|
@@ -56,7 +56,7 @@ or add manually in `Gemfile`:
|
|
56
56
|
|
57
57
|
```ruby
|
58
58
|
group :bridgetown_plugins do
|
59
|
-
gem "bridgetown-plausible", "~>
|
59
|
+
gem "bridgetown-plausible", "~> 1.1.0"
|
60
60
|
end
|
61
61
|
```
|
62
62
|
|
@@ -74,6 +74,14 @@ plausible:
|
|
74
74
|
# Type: String
|
75
75
|
# Required: true
|
76
76
|
domain: example.com
|
77
|
+
# Your Plausible instance domain.
|
78
|
+
# Only set this if you are self-hosting Plausible on your own domain.
|
79
|
+
# Requires https.
|
80
|
+
#
|
81
|
+
# Type: String
|
82
|
+
# Required: false
|
83
|
+
# Default: "plausible.io"
|
84
|
+
server: selfhosted-plausible.com
|
77
85
|
```
|
78
86
|
|
79
87
|
## Usage
|
data/Rakefile
CHANGED
@@ -8,8 +8,8 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.authors = ["Andrew Mason"]
|
9
9
|
spec.email = ["andrewmcodes@protonmail.com"]
|
10
10
|
spec.summary = "Plausible Analytics Plugin for Bridgetown"
|
11
|
-
spec.description = "
|
12
|
-
spec.homepage = "https://github.com/
|
11
|
+
spec.description = "Provides a Liquid Tag and ERB Helper to add Plausible analytics to your Bridgetown site."
|
12
|
+
spec.homepage = "https://github.com/bt-rb/#{spec.name}"
|
13
13
|
spec.license = "MIT"
|
14
14
|
spec.metadata = {
|
15
15
|
"bug_tracker_uri" => "#{spec.homepage}/issues",
|
data/bridgetown.automation.rb
CHANGED
@@ -1,16 +1,27 @@
|
|
1
|
-
say_status :plausible, "Installing the bridgetown-plausible
|
1
|
+
say_status :plausible, "Installing the bridgetown-plausible plugin..."
|
2
2
|
|
3
3
|
domain_name = ask("What's your Plausible domain?")
|
4
|
+
server_name = ask("If you are self-hosting Plausible, what's your instance domain? Leave blank if not self-hosting to default to plausible.io")
|
5
|
+
add_bridgetown_plugin "bridgetown-plausible"
|
4
6
|
|
5
|
-
|
7
|
+
if server_name == ""
|
8
|
+
append_to_file "bridgetown.config.yml" do
|
9
|
+
<<~YAML
|
6
10
|
|
7
|
-
|
8
|
-
|
11
|
+
plausible:
|
12
|
+
domain: #{domain_name}
|
13
|
+
YAML
|
14
|
+
end
|
15
|
+
else
|
16
|
+
append_to_file "bridgetown.config.yml" do
|
17
|
+
<<~YAML
|
9
18
|
|
10
|
-
|
11
|
-
|
12
|
-
|
19
|
+
plausible:
|
20
|
+
domain: #{domain_name}
|
21
|
+
server: #{server_name}
|
22
|
+
YAML
|
23
|
+
end
|
13
24
|
end
|
14
25
|
|
15
26
|
say_status :plausible, "All set! Double-check the plausible block in your config file and review docs at"
|
16
|
-
say_status :plausible, "https://github.com/
|
27
|
+
say_status :plausible, "https://github.com/bt-rb/bridgetown-plausible"
|
data/demo/Gemfile
CHANGED
data/demo/bridgetown.config.yml
CHANGED
@@ -27,4 +27,12 @@ plausible:
|
|
27
27
|
#
|
28
28
|
# Type: String
|
29
29
|
# Required: true
|
30
|
-
domain:
|
30
|
+
domain: tracked-site.com
|
31
|
+
# Your Plausible instance domain.
|
32
|
+
# Only set this if you are self-hosting Plausible on your own domain.
|
33
|
+
# Requires https.
|
34
|
+
#
|
35
|
+
# Type: String
|
36
|
+
# Required: false
|
37
|
+
# Default: "plausible.io"
|
38
|
+
server: selfhosted-plausible.com
|
@@ -5,11 +5,11 @@ module Bridgetown
|
|
5
5
|
class Builder < Bridgetown::Builder
|
6
6
|
def build
|
7
7
|
liquid_tag "plausible" do |_attributes, tag|
|
8
|
-
render
|
8
|
+
render.html_safe
|
9
9
|
end
|
10
10
|
|
11
11
|
helper "plausible" do
|
12
|
-
render
|
12
|
+
render.html_safe
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
@@ -17,12 +17,13 @@ module Bridgetown
|
|
17
17
|
|
18
18
|
def render
|
19
19
|
domain = options.dig(:domain)&.strip
|
20
|
+
server = options.dig(:server)&.strip || "plausible.io"
|
20
21
|
|
21
22
|
tag = if domain
|
22
|
-
|
23
|
+
markup_for_snippet(domain, server)
|
23
24
|
else
|
24
25
|
Bridgetown.logger.warn "Plausible", "Domain not configured."
|
25
|
-
|
26
|
+
markup_for_snippet("NOT CONFIGURED", server)
|
26
27
|
end
|
27
28
|
|
28
29
|
return wrap_with_comment(tag) unless Bridgetown.environment.production?
|
@@ -30,8 +31,8 @@ module Bridgetown
|
|
30
31
|
tag
|
31
32
|
end
|
32
33
|
|
33
|
-
def
|
34
|
-
"<script async defer data-domain=\"#{domain}\" src=\"https
|
34
|
+
def markup_for_snippet(domain, server)
|
35
|
+
"<script async defer data-domain=\"#{domain}\" src=\"https://#{server}/js/plausible.js\"></script>"
|
35
36
|
end
|
36
37
|
|
37
38
|
def wrap_with_comment(tag)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bridgetown-plausible
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Mason
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-09-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bridgetown
|
@@ -100,7 +100,8 @@ dependencies:
|
|
100
100
|
- - "~>"
|
101
101
|
- !ruby/object:Gem::Version
|
102
102
|
version: '0.12'
|
103
|
-
description:
|
103
|
+
description: Provides a Liquid Tag and ERB Helper to add Plausible analytics to your
|
104
|
+
Bridgetown site.
|
104
105
|
email:
|
105
106
|
- andrewmcodes@protonmail.com
|
106
107
|
executables: []
|
@@ -142,15 +143,15 @@ files:
|
|
142
143
|
- lib/bridgetown-plausible.rb
|
143
144
|
- lib/bridgetown-plausible/builder.rb
|
144
145
|
- lib/bridgetown-plausible/version.rb
|
145
|
-
homepage: https://github.com/
|
146
|
+
homepage: https://github.com/bt-rb/bridgetown-plausible
|
146
147
|
licenses:
|
147
148
|
- MIT
|
148
149
|
metadata:
|
149
|
-
bug_tracker_uri: https://github.com/
|
150
|
-
changelog_uri: https://github.com/
|
151
|
-
documentation_uri: https://github.com/
|
152
|
-
homepage_uri: https://github.com/
|
153
|
-
source_code_uri: https://github.com/
|
150
|
+
bug_tracker_uri: https://github.com/bt-rb/bridgetown-plausible/issues
|
151
|
+
changelog_uri: https://github.com/bt-rb/bridgetown-plausible/blob/main/CHANGELOG.md
|
152
|
+
documentation_uri: https://github.com/bt-rb/bridgetown-plausible
|
153
|
+
homepage_uri: https://github.com/bt-rb/bridgetown-plausible
|
154
|
+
source_code_uri: https://github.com/bt-rb/bridgetown-plausible
|
154
155
|
post_install_message:
|
155
156
|
rdoc_options: []
|
156
157
|
require_paths:
|