jekyll-attendease 0.6.43.1 → 0.6.43.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 36d0d817712d4126ee5f0676cd4144dcc5335beb
|
4
|
+
data.tar.gz: aec70c6a21e694d4f14d7ca85c94704f90354165
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f2fc7ad5c50e674d603aae04aee3324b289b3b1eb38809cac940cf4e8ff25716ff103f5edb4314023563b223c921be147906f394efbf7862f64889021025c304
|
7
|
+
data.tar.gz: 5e2b83f716a76393cb9b97b846cf38c262546b188735edeff3777e4fe0c01ae8d3a5b3140d363a854c69883fa67943e7ce1b94326f5855baccbf0b56e0332b4d
|
data/lib/jekyll-attendease.rb
CHANGED
@@ -21,5 +21,6 @@ Liquid::Template.register_tag('attendease_analytics_gtm_body', Jekyll::Attendeas
|
|
21
21
|
Liquid::Template.register_tag('attendease_analytics_ga_gtag', Jekyll::AttendeasePlugin::AnalyticsGoogleAnalyticsGtagTag)
|
22
22
|
Liquid::Template.register_tag('attendease_analytics_facebook', Jekyll::AttendeasePlugin::AnalyticsFacebookPixelTag)
|
23
23
|
Liquid::Template.register_tag('attendease_analytics_linkedin', Jekyll::AttendeasePlugin::AnalyticsLinkedInTag)
|
24
|
+
Liquid::Template.register_tag('attendease_analytics_settings', Jekyll::AttendeasePlugin::AnalyticsSettingsTag)
|
24
25
|
|
25
26
|
Liquid::Template.register_filter(Jekyll::AttendeasePlugin::Filters)
|
@@ -326,8 +326,6 @@ _EOT
|
|
326
326
|
|| analytics['googleAnalyticsTrackingId'].nil? \
|
327
327
|
|| analytics['googleAnalyticsTrackingId'].empty?
|
328
328
|
|
329
|
-
return '' if analytics.nil? || !analytics['googleAnalyticsTrackingId']
|
330
|
-
|
331
329
|
adwordsId = analytics['googleAnalyticsAdwordsId']
|
332
330
|
script = <<_EOT
|
333
331
|
<!-- Global Site Tag (gtag.js) - Google Analytics -->
|
@@ -379,7 +377,6 @@ _EOT
|
|
379
377
|
site_settings = context.registers[:site].data['site_settings'].clone
|
380
378
|
analytics = site_settings['analytics']
|
381
379
|
|
382
|
-
return '' if analytics.nil? || !analytics['facebookPixelId']
|
383
380
|
return '' if analytics.nil? \
|
384
381
|
|| analytics['facebookPixelId'].nil? \
|
385
382
|
|| analytics['facebookPixelId'].empty?
|
@@ -401,6 +398,29 @@ _EOT
|
|
401
398
|
src="https://www.facebook.com/tr?id=#{analytics['facebookPixelId']}&ev=PageView&noscript=1"
|
402
399
|
/></noscript>
|
403
400
|
<!-- End Facebook Pixel Code -->
|
401
|
+
_EOT
|
402
|
+
script
|
403
|
+
end
|
404
|
+
end
|
405
|
+
|
406
|
+
class AnalyticsSettingsTag < Liquid::Tag
|
407
|
+
def render(context)
|
408
|
+
site_settings = context.registers[:site].data['site_settings'].clone
|
409
|
+
analytics = site_settings['analytics']
|
410
|
+
|
411
|
+
return '' if analytics.nil? \
|
412
|
+
|
413
|
+
# the id keys we want to expose
|
414
|
+
keys = %w[ googleAnalyticsTrackingId ]
|
415
|
+
analytic_ids = analytics.select { |k, v| keys.include?(k) }
|
416
|
+
|
417
|
+
script = <<_EOT
|
418
|
+
<!-- Global Analytics Settings -->
|
419
|
+
<script>
|
420
|
+
window.AnalyticsSettings = {
|
421
|
+
#{ analytic_ids.map { |k, v| " #{k}: #{v.to_json}" }.join(",\n")}
|
422
|
+
}
|
423
|
+
</script>
|
404
424
|
_EOT
|
405
425
|
script
|
406
426
|
end
|
@@ -150,6 +150,14 @@ RSpec.describe "Jekyll Attendease tags" do
|
|
150
150
|
it { is_expected.to match(/Facebook Pixel Code/) }
|
151
151
|
it { is_expected.to match(/foo/) }
|
152
152
|
end
|
153
|
+
|
154
|
+
describe "{% attendease_analytics_settings %}" do
|
155
|
+
subject { cms_render("{% attendease_analytics_settings %}") }
|
156
|
+
|
157
|
+
it { is_expected.to match(/Global Analytics Settings/) }
|
158
|
+
it { is_expected.to match(/googleAnalyticsTrackingId: "foo"/) }
|
159
|
+
it { is_expected.to match(/window.AnalyticsSettings = /) }
|
160
|
+
end
|
153
161
|
end
|
154
162
|
|
155
163
|
def schedule_widget_data
|
metadata
CHANGED
@@ -1,17 +1,18 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-attendease
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.43.
|
4
|
+
version: 0.6.43.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Wood
|
8
8
|
- Patrick Gibson
|
9
9
|
- Jamie Lubiner
|
10
10
|
- Antoine Censi
|
11
|
+
- Adrian Jones
|
11
12
|
autorequire:
|
12
13
|
bindir: bin
|
13
14
|
cert_chain: []
|
14
|
-
date: 2018-11-
|
15
|
+
date: 2018-11-28 00:00:00.000000000 Z
|
15
16
|
dependencies:
|
16
17
|
- !ruby/object:Gem::Dependency
|
17
18
|
name: httparty
|