betterplace-content 0.7.122 → 0.7.125
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 +4 -4
- data/_layouts/default.html +13 -2
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d084c61df4becd59c023de0e39275110342e8cff0556958e93a1bf33a6c1460e
|
|
4
|
+
data.tar.gz: 9553e8952cfdb4fbfa38a391e18bfdd690e122c3be8729674b860ac861a197dc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1bf04ac69f54b0ef487b7081655dc8ce8ff8589d43f51d0aa7ca44cb351ce475cbeefde475b5a3bd6b14b91769be82734a33039e1e5a2015cbb9c521b93672bf
|
|
7
|
+
data.tar.gz: bb4eb0727f13e60c90cd0d5ea1ce89e99122931d93854645ad094694211934bcbac1e9cbb919a4aa75e80922af864d2c602d5fa46f59f4e0139832263e98b79c
|
data/_layouts/default.html
CHANGED
|
@@ -133,9 +133,20 @@ Update 2019-07-19: Another problem that came us is, that URLs endet in .html whi
|
|
|
133
133
|
})
|
|
134
134
|
})
|
|
135
135
|
|
|
136
|
-
const
|
|
136
|
+
const updateLinks = () => {
|
|
137
|
+
// attach utm params to bp links, except those that already have utm params
|
|
138
|
+
const utmParams = [...window.location.search.matchAll(/utm[^=]+=[^&]+/g)].join('&')
|
|
139
|
+
if (utmParams) {
|
|
140
|
+
document.querySelectorAll("a[href]").forEach(a => {
|
|
141
|
+
if (/(^\/|\.(bp|betterplace))(?!.*[?&]utm)/.test(a.href)) {
|
|
142
|
+
a.href = `${a.href}${a.href.includes('?') ? '&' : '?'}${utmParams}`
|
|
143
|
+
}
|
|
144
|
+
})
|
|
145
|
+
}
|
|
146
|
+
|
|
137
147
|
if (/\.(?:org|dev|cloud)/.test(window.location.hostname)) return
|
|
138
148
|
|
|
149
|
+
// replace host, e.g. with staging host
|
|
139
150
|
document.querySelectorAll("[href]").forEach(element => {
|
|
140
151
|
if (element.href.includes('www.betterplace.org')) {
|
|
141
152
|
element.href = element.href.replace('www.betterplace.org', window.location.hostname)
|
|
@@ -144,7 +155,7 @@ Update 2019-07-19: Another problem that came us is, that URLs endet in .html whi
|
|
|
144
155
|
})
|
|
145
156
|
}
|
|
146
157
|
|
|
147
|
-
document.addEventListener('DOMContentLoaded',
|
|
158
|
+
document.addEventListener('DOMContentLoaded', updateLinks)
|
|
148
159
|
</script>
|
|
149
160
|
</body>
|
|
150
161
|
</html>
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: betterplace-content
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.7.
|
|
4
|
+
version: 0.7.125
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- betterplace.org Developers
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2022-
|
|
11
|
+
date: 2022-12-19 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: jekyll
|