bridgetown-plausible 1.0.2 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 274f79cc340a1931282e1576222faebb147fa5e0e21f7339210c9015b096c3fd
4
- data.tar.gz: 1ab93674cee6b180c53b12666948c4011a18c76b6e38bdf5052a177ddd4cd749
3
+ metadata.gz: 10343f5050a55a466fe11cd10ec55761b7053e7e1a67a81108f2805c9f4f6cb7
4
+ data.tar.gz: 904bb7ecfaa65c5cd1a973e9f845f05bde996eabec8174788e49d1c04e05a352
5
5
  SHA512:
6
- metadata.gz: 201335bca947648ae012be89419bc8e323fd8107805a0cfb0f3934682edffd785b6fca95be75f568d9109a9c320d7f6356b20e985cbded39d2896914d23ab06e
7
- data.tar.gz: ba0f6c7e5f669dd49800ce3f9bea12ea60081cb313c4cb883cdcbc6d2e5e2519ccd1eb77cae0e18f4234cf97525427fe3641d3e65b5e589b51a33bedc7daa003
6
+ metadata.gz: 9a2f9182c506d83656ade3fb971b1d3c74b6fc5e922a4ae78c3f9e8c404799f7ee55ffc94aab502a465f8cd6523579b6e8c66efff77359ba096cf6f103735978
7
+ data.tar.gz: a832d653bf4cabad842bd604bd5ee7a613b8052f6ee62582318a9f9edfcd239829605929d7523a63145ee328c6994fdf00afc49260db8afa6dbccfa7d5a117c9
@@ -13,13 +13,11 @@ jobs:
13
13
  runs-on: ubuntu-latest
14
14
  if: "!contains(github.event.head_commit.message, 'ci skip')"
15
15
  steps:
16
- - uses: actions/checkout@v2
16
+ - uses: actions/checkout@v6
17
17
  - name: Set up Ruby
18
18
  uses: ruby/setup-ruby@v1
19
19
  with:
20
- ruby-version: 3.0.0
20
+ ruby-version: "3.3"
21
+ bundler-cache: true
21
22
  - name: Run bin/lint
22
- run: |
23
- gem install bundler -v 2.2.7
24
- bundle install
25
- bin/lint
23
+ run: bin/lint
@@ -4,37 +4,34 @@ on:
4
4
  push:
5
5
  branches:
6
6
  - main
7
+
8
+ permissions:
9
+ contents: write
10
+ pull-requests: write
11
+
7
12
  jobs:
8
13
  release-please:
9
14
  runs-on: ubuntu-latest
10
15
  steps:
11
- - uses: GoogleCloudPlatform/release-please-action@v2
16
+ - uses: googleapis/release-please-action@v5
12
17
  id: release
13
18
  with:
14
19
  token: ${{ secrets.GITHUB_TOKEN }}
15
- release-type: ruby
16
- package-name: bridgetown-plausible
17
- bump-minor-pre-major: true
18
- version-file: "lib/bridgetown-plausible/version.rb"
19
- - uses: actions/checkout@v2
20
+ config-file: release-please-config.json
21
+ manifest-file: .release-please-manifest.json
22
+ - uses: actions/checkout@v6
20
23
  if: ${{ steps.release.outputs.release_created }}
21
24
  - uses: ruby/setup-ruby@v1
22
25
  with:
23
- ruby-version: 3.0.0
26
+ ruby-version: "3.3"
27
+ bundler-cache: true
24
28
  if: ${{ steps.release.outputs.release_created }}
25
- - run: |
26
- gem install bundler -v 2.2.7
27
- bundle install
28
- bundle exec rake
29
+ - run: bundle exec rake
29
30
  if: ${{ steps.release.outputs.release_created }}
30
31
  - name: release gem
31
32
  run: |
32
- mkdir -p $HOME/.gem
33
- touch $HOME/.gem/credentials
34
- chmod 0600 $HOME/.gem/credentials
35
- printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
36
33
  gem build *.gemspec
37
34
  gem push *.gem
38
35
  env:
39
- GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}"
36
+ GEM_HOST_API_KEY: ${{ secrets.RUBYGEMS_AUTH_TOKEN }}
40
37
  if: ${{ steps.release.outputs.release_created }}
@@ -9,19 +9,31 @@ on:
9
9
  - main
10
10
 
11
11
  jobs:
12
- lint:
12
+ test:
13
13
  runs-on: ubuntu-latest
14
14
  if: "!contains(github.event.head_commit.message, 'ci skip')"
15
+ strategy:
16
+ fail-fast: false
17
+ matrix:
18
+ include:
19
+ # Bridgetown 1.3 — oldest supported, sanity-check on newest Ruby
20
+ - { ruby: "3.1", bridgetown: "~> 1.3.4" }
21
+ - { ruby: "3.3", bridgetown: "~> 1.3.4" }
22
+ # Bridgetown 2.0 — first 2.x line (helper/filter scoping options deprecated)
23
+ - { ruby: "3.2", bridgetown: "~> 2.0.0" }
24
+ # Bridgetown 2.1 — Active Support removed (verifies .html_safe still works)
25
+ - { ruby: "3.2", bridgetown: "~> 2.1.0" }
26
+ # Bridgetown 2.2 — current
27
+ - { ruby: "3.3", bridgetown: "~> 2.2.0" }
28
+ env:
29
+ BRIDGETOWN_VERSION: ${{ matrix.bridgetown }}
15
30
  steps:
16
- - uses: actions/checkout@v2
31
+ - uses: actions/checkout@v6
17
32
  - name: Set up Ruby
18
33
  uses: ruby/setup-ruby@v1
19
34
  with:
20
- ruby-version: 3.0.0
35
+ ruby-version: ${{ matrix.ruby }}
36
+ bundler-cache: true
37
+ cache-version: "${{ matrix.ruby }}-${{ matrix.bridgetown }}"
21
38
  - name: Run specs
22
- run: |
23
- gem install bundler -v 2.2.7
24
- bundle install
25
- rake
26
- env:
27
- COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
39
+ run: bundle exec rake
@@ -0,0 +1,3 @@
1
+ {
2
+ ".": "2.0.0"
3
+ }
data/CHANGELOG.md CHANGED
@@ -1,5 +1,34 @@
1
1
  # Changelog
2
2
 
3
+ ## [2.0.0](https://github.com/bt-rb/bridgetown-plausible/compare/bridgetown-plausible-v1.1.0...bridgetown-plausible/v2.0.0) (2026-05-21)
4
+
5
+
6
+ ### ⚠ BREAKING CHANGES
7
+
8
+ * requires init :"bridgetown-plausible"; drops Bridgetown < 1.3 support. Users on older Bridgetown should stay on bridgetown-plausible 1.1.x.
9
+
10
+ ### Features
11
+
12
+ * make server configurable ([#11](https://github.com/bt-rb/bridgetown-plausible/issues/11)) ([5c5cd29](https://github.com/bt-rb/bridgetown-plausible/commit/5c5cd296477bee6eb6ce38e32051968291995d44))
13
+ * support Bridgetown 2.x (and 1.3+) ([#15](https://github.com/bt-rb/bridgetown-plausible/issues/15))` ([28aa6f1](https://github.com/bt-rb/bridgetown-plausible/commit/28aa6f152d54640db0bd3eb5b59675dede49c137))
14
+
15
+
16
+ ### Bug Fixes
17
+
18
+ * correct logo url ([#1](https://github.com/bt-rb/bridgetown-plausible/issues/1)) ([22db435](https://github.com/bt-rb/bridgetown-plausible/commit/22db43569e90375c1895f20c232607a93f9bf023))
19
+ * correct test action name ([1d0526a](https://github.com/bt-rb/bridgetown-plausible/commit/1d0526a7eb1fe608dfba174b11b76490870d6dc2))
20
+ * fix gem name in release action ([a3614df](https://github.com/bt-rb/bridgetown-plausible/commit/a3614df2cdddea6314b9baddcb697b3aa07b0c7f))
21
+ * use correct link to repo in gemspec and render safe html ([#9](https://github.com/bt-rb/bridgetown-plausible/issues/9)) ([02e61b9](https://github.com/bt-rb/bridgetown-plausible/commit/02e61b9930240c3b2810627da1e4b357c7563b33))
22
+ * use correct package name in automation ([#10](https://github.com/bt-rb/bridgetown-plausible/issues/10)) ([82eb300](https://github.com/bt-rb/bridgetown-plausible/commit/82eb3002ce83d822cab96cbe722c1516635fa8dc)), closes [#6](https://github.com/bt-rb/bridgetown-plausible/issues/6) [#7](https://github.com/bt-rb/bridgetown-plausible/issues/7)
23
+ * use the correct url for the automation in our readme docs ([b2b5961](https://github.com/bt-rb/bridgetown-plausible/commit/b2b596132b4452d93cfca8e6227c82d766a8691d)), closes [#4](https://github.com/bt-rb/bridgetown-plausible/issues/4)
24
+
25
+ ## [1.1.0](https://www.github.com/bt-rb/bridgetown-plausible/compare/v1.0.2...v1.1.0) (2022-09-22)
26
+
27
+
28
+ ### Features
29
+
30
+ * 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))
31
+
3
32
  ### [1.0.2](https://www.github.com/bt-rb/bridgetown-plausible/compare/v1.0.1...v1.0.2) (2021-12-22)
4
33
 
5
34
 
data/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2020-present Andrew Mason
3
+ Copyright (c) 2020-2026 Andrew Mason
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining
6
6
  a copy of this software and associated documentation files (the
data/README.md CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  <p align="center">
8
8
  <a href="https://badge.fury.io/rb/bridgetown-plausible"><img src="https://badge.fury.io/rb/bridgetown-plausible.svg" alt="Gem Version" height="18"></a>
9
- <img src="https://img.shields.io/github/license/bt-rb/.github">
9
+ <img src="https://img.shields.io/github/license/bt-rb/bridgetown-plausible" alt="license">
10
10
  <img src="https://github.com/bt-rb/bridgetown-plausible/workflows/Test/badge.svg" alt="test">
11
11
  <img src="https://github.com/bt-rb/bridgetown-plausible/workflows/Lint/badge.svg" alt="lint">
12
12
  <img src="https://github.com/bt-rb/bridgetown-plausible/workflows/Release/badge.svg" alt="release">
@@ -22,6 +22,7 @@
22
22
  - [Quickstart](#quickstart)
23
23
  - [System requirements](#system-requirements)
24
24
  - [Installation](#installation)
25
+ - [Upgrading from 1.x](#upgrading-from-1x)
25
26
  - [Configuration](#configuration)
26
27
  - [Usage](#usage)
27
28
  - [Liquid](#liquid)
@@ -40,30 +41,56 @@ bundle exec bridgetown apply https://github.com/bt-rb/bridgetown-plausible
40
41
 
41
42
  ## System requirements
42
43
 
43
- - Ruby >= `2.5`
44
44
  - Bundler
45
- - Bridgetown >= `0.16`
45
+ - Ruby >= `3.1`
46
+ - Bridgetown >= `1.3` (tested against Bridgetown 1.3.x, 2.0.x, 2.1.x, and 2.2.x)
47
+
48
+ Bridgetown itself sets its own Ruby floor: 1.3.x needs `>= 2.7`, 2.0.x needs `>= 3.1`, 2.1.x and 2.2.x need `>= 3.2`. This gem requires `>= 3.1` to match what we test in CI; if you need Ruby 2.7 or 3.0 on Bridgetown 1.3, stay on `bridgetown-plausible "~> 1.1"`.
46
49
 
47
50
  ## Installation
48
51
 
49
- Automatically add to `Gemfile`:
52
+ Add to your `Gemfile`:
50
53
 
51
54
  ```bash
52
55
  bundle add bridgetown-plausible -g bridgetown_plugins
53
56
  ```
54
57
 
55
- or add manually in `Gemfile`:
58
+ or manually:
56
59
 
57
60
  ```ruby
58
61
  group :bridgetown_plugins do
59
- gem "bridgetown-plausible", "~> 1.0.2"
62
+ gem "bridgetown-plausible", "~> 2.0"
63
+ end
64
+ ```
65
+
66
+ Then configure the plugin in your `config/initializers.rb` — the recommended path is to pass your domain (and self-hosted server, if applicable) inline:
67
+
68
+ ```ruby
69
+ Bridgetown.configure do |config|
70
+ # ...your existing config...
71
+
72
+ init :"bridgetown-plausible" do
73
+ domain "example.com"
74
+ # server "stats.example.com" # optional, defaults to plausible.io
75
+ end
60
76
  end
61
77
  ```
62
78
 
63
- Run `bundle install` and then modify your `bridgetown.config.yml` configuration to point to your Plausible domain.
79
+ Alternatively, you can configure via `bridgetown.config.yml` (see [Configuration](#configuration) below) and use the bare `init :"bridgetown-plausible"` form. Precedence is per-key: any kwarg you pass overrides the matching YAML key, and keys you don't pass continue to come from YAML. So passing only `domain` in the init block will still pick up `server` from `bridgetown.config.yml` if it's set there.
80
+
81
+ ## Upgrading from 1.x
82
+
83
+ Version 2.0 is a breaking change:
84
+
85
+ - **Requires Bridgetown >= 1.3.** If you're on an older Bridgetown, stay on `bridgetown-plausible "~> 1.1"` until you can upgrade.
86
+ - **The gem no longer auto-registers on `require`.** You must explicitly opt in by adding `init :"bridgetown-plausible"` to your `config/initializers.rb` (see [Installation](#installation)). Without this, builds calling `<%= plausible %>` will raise `NameError: undefined local variable or method 'plausible'`, and `{% plausible %}` will raise `Liquid::SyntaxError`.
87
+ - **Ruby >= 3.1** (matching what we test in CI). See [System requirements](#system-requirements) for the per-Bridgetown-version Ruby floors set by Bridgetown itself.
88
+ - **Active Support was removed from Bridgetown in 2.1.** The plugin's `.html_safe` calls continue to work via `bridgetown-foundation`, which Bridgetown ships by default — no action needed.
64
89
 
65
90
  ## Configuration
66
91
 
92
+ You can configure via the initializer kwargs shown in [Installation](#installation), or via `bridgetown.config.yml`:
93
+
67
94
  ```yml
68
95
  # bridgetown.config.yml
69
96
 
@@ -74,11 +101,19 @@ plausible:
74
101
  # Type: String
75
102
  # Required: true
76
103
  domain: example.com
104
+ # Your Plausible instance domain.
105
+ # Only set this if you are self-hosting Plausible on your own domain.
106
+ # Requires https.
107
+ #
108
+ # Type: String
109
+ # Required: false
110
+ # Default: "plausible.io"
111
+ server: selfhosted-plausible.com
77
112
  ```
78
113
 
79
114
  ## Usage
80
115
 
81
- This plugin provides the `plausible` Liquid tag & ERB helper to your site. If `BRIDGETOWN_ENV` is not `production`, than the tag will be wrapped in an HTML comment to prevent console erros in development. Make sure you set `BRIDGETOWN_ENV="production"` when you deploy in your script or in Netlify/Vercel/etc.
116
+ This plugin provides the `plausible` Liquid tag & ERB helper to your site. If `BRIDGETOWN_ENV` is not `production`, then the tag will be wrapped in an HTML comment to prevent console errors in development. Make sure you set `BRIDGETOWN_ENV="production"` when you deploy in your script or in Netlify/Vercel/etc.
82
117
 
83
118
  Use the tag in the head of your document:
84
119
 
@@ -106,4 +141,4 @@ Please make sure to read the [Contributing Guide](.github/CONTRIBUTING.md) befor
106
141
 
107
142
  [MIT](https://opensource.org/licenses/MIT)
108
143
 
109
- Copyright (c) 2021-present, Andrew Mason
144
+ Copyright (c) 2020-2026, Andrew Mason
data/Rakefile CHANGED
@@ -5,4 +5,4 @@ require "rspec/core/rake_task"
5
5
 
6
6
  RSpec::Core::RakeTask.new(:spec)
7
7
 
8
- task :default => :spec
8
+ task default: :spec
@@ -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 = "A Liquid tag to add Plausible analytics to your site."
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 = {
@@ -16,18 +16,18 @@ Gem::Specification.new do |spec|
16
16
  "changelog_uri" => "#{spec.homepage}/blob/main/CHANGELOG.md",
17
17
  "documentation_uri" => spec.homepage.to_s,
18
18
  "homepage_uri" => spec.homepage.to_s,
19
- "source_code_uri" => spec.homepage.to_s
19
+ "source_code_uri" => spec.homepage.to_s,
20
+ "rubygems_mfa_required" => "true"
20
21
  }
21
22
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|script|spec|features|frontend)/}) }
22
- spec.test_files = spec.files.grep(%r{^spec/})
23
23
  spec.require_paths = ["lib"]
24
- spec.required_ruby_version = Gem::Requirement.new(">= 2.5.0")
24
+ spec.required_ruby_version = Gem::Requirement.new(">= 3.1.0")
25
25
 
26
- spec.add_dependency "bridgetown", ">= 0.16", "< 2.0"
26
+ spec.add_dependency "bridgetown", ">= 1.3"
27
27
 
28
28
  spec.add_development_dependency "bundler"
29
- spec.add_development_dependency "nokogiri", "~> 1.6"
29
+ spec.add_development_dependency "nokogiri", "~> 1.16"
30
30
  spec.add_development_dependency "rake", "~> 13.0"
31
31
  spec.add_development_dependency "rspec", "~> 3.0"
32
- spec.add_development_dependency "standard", "~> 0.12"
32
+ spec.add_development_dependency "standard", "~> 1.41"
33
33
  end
@@ -1,16 +1,37 @@
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
- append_to_file "bridgetown.config.yml" do
8
- <<~YAML
7
+ init_block = if server_name.to_s.strip.empty?
8
+ <<~RUBY
9
+
10
+ init :"bridgetown-plausible" do
11
+ domain #{domain_name.inspect}
12
+ end
13
+ RUBY
14
+ else
15
+ <<~RUBY
16
+
17
+ init :"bridgetown-plausible" do
18
+ domain #{domain_name.inspect}
19
+ server #{server_name.inspect}
20
+ end
21
+ RUBY
22
+ end
9
23
 
10
- plausible:
11
- domain: #{domain_name}
12
- YAML
24
+ if File.exist?("config/initializers.rb")
25
+ if File.read("config/initializers.rb").include?(%(init :"bridgetown-plausible"))
26
+ say_status :plausible, "config/initializers.rb already calls `init :\"bridgetown-plausible\"` — skipping."
27
+ else
28
+ # Indent the init block to match the surrounding Bridgetown.configure block
29
+ indented = init_block.lines.map { |l| (l == "\n") ? l : " #{l}" }.join
30
+ inject_into_file "config/initializers.rb", indented, before: /^end\s*\z/
31
+ end
32
+ else
33
+ say_status :plausible, "config/initializers.rb not found. bridgetown-plausible 2.x requires Bridgetown >= 1.3."
34
+ say_status :plausible, "Upgrade Bridgetown to 1.3+ (and configure via config/initializers.rb), or use bridgetown-plausible `~> 1.1` for older Bridgetown sites."
13
35
  end
14
36
 
15
- 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/bt-rb/bridgetown-plausible"
37
+ say_status :plausible, "All set! Review docs at https://github.com/bt-rb/bridgetown-plausible"
data/demo/Gemfile CHANGED
@@ -16,7 +16,7 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
16
16
  #
17
17
  # Happy Bridgetowning!
18
18
 
19
- gem "bridgetown", "~> 0.19.2"
19
+ gem "bridgetown", "~> 2.2"
20
20
  group :bridgetown_plugins do
21
21
  gem "bridgetown-plausible", path: "../"
22
22
  end
@@ -27,4 +27,12 @@ plausible:
27
27
  #
28
28
  # Type: String
29
29
  # Required: true
30
- domain: example.com
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
@@ -0,0 +1,5 @@
1
+ Bridgetown.configure do |config|
2
+ template_engine "liquid"
3
+
4
+ init :"bridgetown-plausible"
5
+ end
@@ -1,4 +1,3 @@
1
1
  class SiteBuilder < Bridgetown::Builder
2
2
  # write builders which subclass SiteBuilder in plugins/builder
3
3
  end
4
-
@@ -6,6 +6,7 @@
6
6
  <title>{{ metadata.title }}</title>
7
7
  <meta name="description" content="{{ metadata.description }}" />
8
8
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/mini.css/3.0.1/mini-default.min.css">
9
+ {% plausible %}
9
10
  </head>
10
11
  <body class="{{ page.layout }} {{ page.page_class }}">
11
12
  <header>
@@ -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
- markup_for_domain(domain)
23
+ markup_for_snippet(domain, server)
23
24
  else
24
25
  Bridgetown.logger.warn "Plausible", "Domain not configured."
25
- markup_for_domain("NOT CONFIGURED")
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 markup_for_domain(domain)
34
- "<script async defer data-domain=\"#{domain}\" src=\"https://plausible.io/js/plausible.js\"></script>"
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)
@@ -44,5 +45,3 @@ module Bridgetown
44
45
  end
45
46
  end
46
47
  end
47
-
48
- Bridgetown::Plausible::Builder.register
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Bridgetown
4
4
  module Plausible
5
- VERSION = "1.0.2"
5
+ VERSION = "2.0.0"
6
6
  end
7
7
  end
@@ -2,3 +2,14 @@
2
2
 
3
3
  require "bridgetown"
4
4
  require "bridgetown-plausible/builder"
5
+ require "bridgetown-plausible/version"
6
+
7
+ Bridgetown.initializer :"bridgetown-plausible" do |config, domain: nil, server: nil|
8
+ # `config.set` deep-merges the new hash into any existing one (e.g. from bridgetown.config.yml),
9
+ # so per-key precedence works as expected: kwargs override matching YAML keys, and any keys not
10
+ # passed as kwargs survive from YAML.
11
+ overrides = {"domain" => domain, "server" => server}.compact
12
+ config.set "plausible", overrides if overrides.any?
13
+
14
+ config.builder Bridgetown::Plausible::Builder
15
+ end
@@ -0,0 +1,11 @@
1
+ {
2
+ "packages": {
3
+ ".": {
4
+ "release-type": "ruby",
5
+ "package-name": "bridgetown-plausible",
6
+ "bump-minor-pre-major": true,
7
+ "version-file": "lib/bridgetown-plausible/version.rb"
8
+ }
9
+ },
10
+ "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json"
11
+ }
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.2
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Mason
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-12-22 00:00:00.000000000 Z
11
+ date: 2026-05-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bridgetown
@@ -16,20 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '0.16'
20
- - - "<"
21
- - !ruby/object:Gem::Version
22
- version: '2.0'
19
+ version: '1.3'
23
20
  type: :runtime
24
21
  prerelease: false
25
22
  version_requirements: !ruby/object:Gem::Requirement
26
23
  requirements:
27
24
  - - ">="
28
25
  - !ruby/object:Gem::Version
29
- version: '0.16'
30
- - - "<"
31
- - !ruby/object:Gem::Version
32
- version: '2.0'
26
+ version: '1.3'
33
27
  - !ruby/object:Gem::Dependency
34
28
  name: bundler
35
29
  requirement: !ruby/object:Gem::Requirement
@@ -50,14 +44,14 @@ dependencies:
50
44
  requirements:
51
45
  - - "~>"
52
46
  - !ruby/object:Gem::Version
53
- version: '1.6'
47
+ version: '1.16'
54
48
  type: :development
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
51
  requirements:
58
52
  - - "~>"
59
53
  - !ruby/object:Gem::Version
60
- version: '1.6'
54
+ version: '1.16'
61
55
  - !ruby/object:Gem::Dependency
62
56
  name: rake
63
57
  requirement: !ruby/object:Gem::Requirement
@@ -92,15 +86,16 @@ dependencies:
92
86
  requirements:
93
87
  - - "~>"
94
88
  - !ruby/object:Gem::Version
95
- version: '0.12'
89
+ version: '1.41'
96
90
  type: :development
97
91
  prerelease: false
98
92
  version_requirements: !ruby/object:Gem::Requirement
99
93
  requirements:
100
94
  - - "~>"
101
95
  - !ruby/object:Gem::Version
102
- version: '0.12'
103
- description: A Liquid tag to add Plausible analytics to your site.
96
+ version: '1.41'
97
+ description: Provides a Liquid Tag and ERB Helper to add Plausible analytics to your
98
+ Bridgetown site.
104
99
  email:
105
100
  - andrewmcodes@protonmail.com
106
101
  executables: []
@@ -115,6 +110,7 @@ files:
115
110
  - ".github/workflows/release.yml"
116
111
  - ".github/workflows/test.yml"
117
112
  - ".gitignore"
113
+ - ".release-please-manifest.json"
118
114
  - ".rspec"
119
115
  - CHANGELOG.md
120
116
  - Gemfile
@@ -130,6 +126,7 @@ files:
130
126
  - bridgetown.automation.rb
131
127
  - demo/Gemfile
132
128
  - demo/bridgetown.config.yml
129
+ - demo/config/initializers.rb
133
130
  - demo/plugins/builders/.keep
134
131
  - demo/plugins/site_builder.rb
135
132
  - demo/src/404.html
@@ -142,6 +139,7 @@ files:
142
139
  - lib/bridgetown-plausible.rb
143
140
  - lib/bridgetown-plausible/builder.rb
144
141
  - lib/bridgetown-plausible/version.rb
142
+ - release-please-config.json
145
143
  homepage: https://github.com/bt-rb/bridgetown-plausible
146
144
  licenses:
147
145
  - MIT
@@ -151,7 +149,8 @@ metadata:
151
149
  documentation_uri: https://github.com/bt-rb/bridgetown-plausible
152
150
  homepage_uri: https://github.com/bt-rb/bridgetown-plausible
153
151
  source_code_uri: https://github.com/bt-rb/bridgetown-plausible
154
- post_install_message:
152
+ rubygems_mfa_required: 'true'
153
+ post_install_message:
155
154
  rdoc_options: []
156
155
  require_paths:
157
156
  - lib
@@ -159,15 +158,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
159
158
  requirements:
160
159
  - - ">="
161
160
  - !ruby/object:Gem::Version
162
- version: 2.5.0
161
+ version: 3.1.0
163
162
  required_rubygems_version: !ruby/object:Gem::Requirement
164
163
  requirements:
165
164
  - - ">="
166
165
  - !ruby/object:Gem::Version
167
166
  version: '0'
168
167
  requirements: []
169
- rubygems_version: 3.2.3
170
- signing_key:
168
+ rubygems_version: 3.5.22
169
+ signing_key:
171
170
  specification_version: 4
172
171
  summary: Plausible Analytics Plugin for Bridgetown
173
172
  test_files: []