bridgetown-plausible 1.0.2 → 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 +7 -0
- data/README.md +9 -1
- data/Rakefile +1 -1
- data/bridgetown-plausible.gemspec +1 -1
- data/bridgetown.automation.rb +17 -6
- 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 +5 -4
- data/lib/bridgetown-plausible/version.rb +1 -1
- metadata +4 -3
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,12 @@
|
|
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
|
+
|
3
10
|
### [1.0.2](https://www.github.com/bt-rb/bridgetown-plausible/compare/v1.0.1...v1.0.2) (2021-12-22)
|
4
11
|
|
5
12
|
|
data/README.md
CHANGED
@@ -56,7 +56,7 @@ or add manually in `Gemfile`:
|
|
56
56
|
|
57
57
|
```ruby
|
58
58
|
group :bridgetown_plugins do
|
59
|
-
gem "bridgetown-plausible", "~> 1.0
|
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,7 +8,7 @@ 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 = "
|
11
|
+
spec.description = "Provides a Liquid Tag and ERB Helper to add Plausible analytics to your Bridgetown site."
|
12
12
|
spec.homepage = "https://github.com/bt-rb/#{spec.name}"
|
13
13
|
spec.license = "MIT"
|
14
14
|
spec.metadata = {
|
data/bridgetown.automation.rb
CHANGED
@@ -1,15 +1,26 @@
|
|
1
1
|
say_status :plausible, "Installing the bridgetown-plausible plugin..."
|
2
2
|
|
3
3
|
domain_name = ask("What's your Plausible domain?")
|
4
|
-
|
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
5
|
add_bridgetown_plugin "bridgetown-plausible"
|
6
6
|
|
7
|
-
|
8
|
-
|
7
|
+
if server_name == ""
|
8
|
+
append_to_file "bridgetown.config.yml" do
|
9
|
+
<<~YAML
|
10
|
+
|
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"
|
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
|
@@ -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: []
|