umberto 4.2.2 → 4.2.4
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.
- package/CHANGELOG.md +12 -0
- package/package.json +1 -1
- package/src/hexo/filter/project-locals.js +3 -0
- package/src/index.js +2 -1
- package/src/tasks/build-documentation.js +6 -0
- package/themes/umberto/layout/_partial/head.pug +1 -1
- package/themes/umberto/layout/_partial/vwo.pug +11 -0
- package/themes/umberto/layout/_partial/google-optimize.pug +0 -15
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
Changelog
|
|
2
2
|
=========
|
|
3
3
|
|
|
4
|
+
## [4.2.4](https://github.com/cksource/umberto/compare/v4.2.3...v4.2.4) (2024-07-17)
|
|
5
|
+
|
|
6
|
+
Internal changes only (updated dependencies, documentation, etc.).
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
## [4.2.3](https://github.com/cksource/umberto/compare/v4.2.2...v4.2.3) (2024-07-10)
|
|
10
|
+
|
|
11
|
+
### Other changes
|
|
12
|
+
|
|
13
|
+
* Replaced Goptimize with VWO. Closes [#1196](https://github.com/cksource/umberto/issues/1196). ([commit](https://github.com/cksource/umberto/commit/6390d8a56b74a202ed81d68764a087c3a2d09f0c))
|
|
14
|
+
|
|
15
|
+
|
|
4
16
|
## [4.2.2](https://github.com/cksource/umberto/compare/v4.2.1...v4.2.2) (2024-06-25)
|
|
5
17
|
|
|
6
18
|
### Other changes
|
package/package.json
CHANGED
|
@@ -20,6 +20,7 @@ const umbertoVersion = require( '../../../package.json' ).version;
|
|
|
20
20
|
* @param {Object} googleoptimize Google Optimize config.
|
|
21
21
|
* @param {Object} googletagmanager Google Tag Manager config.
|
|
22
22
|
* @param {Object} googleanalytics Google Analytics config.
|
|
23
|
+
* @param {Object} vwo Visual Website Optimizer config.
|
|
23
24
|
* @param {Object} feedbackWidget Feedback widget config
|
|
24
25
|
* @param {Array} extraStylePaths Paths to extra external css.
|
|
25
26
|
* @param {Array} extraScriptsPaths Paths to extra external js.
|
|
@@ -34,6 +35,7 @@ module.exports = ( ctx, {
|
|
|
34
35
|
googleoptimize,
|
|
35
36
|
googletagmanager,
|
|
36
37
|
googleanalytics,
|
|
38
|
+
vwo,
|
|
37
39
|
feedbackWidget,
|
|
38
40
|
extraStylePaths,
|
|
39
41
|
extraScriptsPaths,
|
|
@@ -98,6 +100,7 @@ module.exports = ( ctx, {
|
|
|
98
100
|
locals.googleoptimize = googleoptimize;
|
|
99
101
|
locals.googletagmanager = googletagmanager;
|
|
100
102
|
locals.googleanalytics = googleanalytics;
|
|
103
|
+
locals.vwo = vwo;
|
|
101
104
|
locals.feedbackWidget = feedbackWidget;
|
|
102
105
|
locals.mainName = ctx.projectGlobals.common.mainName ? ctx.projectGlobals.common.mainName : '';
|
|
103
106
|
locals.mainLogo = ctx.projectGlobals.common.mainLogo ? ctx.projectGlobals.common.mainLogo : '';
|
package/src/index.js
CHANGED
|
@@ -61,7 +61,8 @@ module.exports = {
|
|
|
61
61
|
googleanalytics: pConfig.googleanalytics,
|
|
62
62
|
feedbackWidget: pConfig.feedbackWidget,
|
|
63
63
|
isSingleProject: true,
|
|
64
|
-
canonicalUrlBeginning: pConfig.canonicalUrlBeginning
|
|
64
|
+
canonicalUrlBeginning: pConfig.canonicalUrlBeginning,
|
|
65
|
+
vwo: pConfig.vwo
|
|
65
66
|
}
|
|
66
67
|
}
|
|
67
68
|
) )
|
|
@@ -138,6 +138,7 @@ module.exports = options => {
|
|
|
138
138
|
googleoptimize: mainConfig.googleoptimize,
|
|
139
139
|
googletagmanager: mainConfig.googletagmanager,
|
|
140
140
|
googleanalytics: mainConfig.googleanalytics,
|
|
141
|
+
vwo: mainConfig.vwo,
|
|
141
142
|
feedbackWidget: mainConfig.feedbackWidget,
|
|
142
143
|
extraStyles,
|
|
143
144
|
extraScripts,
|
|
@@ -309,6 +310,7 @@ function buildProjects( rootPath, projectPaths, options = {} ) {
|
|
|
309
310
|
googleoptimize: options.googleoptimize,
|
|
310
311
|
googletagmanager: options.googletagmanager,
|
|
311
312
|
googleanalytics: options.googleanalytics,
|
|
313
|
+
vwo: options.vwo,
|
|
312
314
|
feedbackWidget: options.feedbackWidget,
|
|
313
315
|
og: options.og,
|
|
314
316
|
canonicalUrlBeginning: options.canonicalUrlBeginning,
|
|
@@ -327,6 +329,7 @@ function buildProjects( rootPath, projectPaths, options = {} ) {
|
|
|
327
329
|
googleoptimize: options.googleoptimize,
|
|
328
330
|
googletagmanager: options.googletagmanager,
|
|
329
331
|
googleanalytics: options.googleanalytics,
|
|
332
|
+
vwo: options.vwo,
|
|
330
333
|
feedbackWidget: options.feedbackWidget,
|
|
331
334
|
og: options.og,
|
|
332
335
|
canonicalUrlBeginning: options.canonicalUrlBeginning,
|
|
@@ -379,6 +382,7 @@ function buildProjects( rootPath, projectPaths, options = {} ) {
|
|
|
379
382
|
googleoptimize: options.googleoptimize,
|
|
380
383
|
googletagmanager: options.googletagmanager,
|
|
381
384
|
googleanalytics: options.googleanalytics,
|
|
385
|
+
vwo: options.vwo,
|
|
382
386
|
feedbackWidget: options.feedbackWidget,
|
|
383
387
|
extraStylePaths: extraStyles,
|
|
384
388
|
extraScriptsPaths: extraScripts,
|
|
@@ -482,6 +486,7 @@ function buildApis( projectConfigs, options = {} ) {
|
|
|
482
486
|
googleoptimize: options.googleoptimize,
|
|
483
487
|
googletagmanager: options.googletagmanager,
|
|
484
488
|
googleanalytics: options.googleanalytics,
|
|
489
|
+
vwo: options.vwo,
|
|
485
490
|
feedbackWidget: options.feedbackWidget,
|
|
486
491
|
pathJoin: upath.join,
|
|
487
492
|
mainOg: options.og || {}
|
|
@@ -550,6 +555,7 @@ function buildSdks( projectConfigs, options = {} ) {
|
|
|
550
555
|
googleoptimize: options.googleoptimize,
|
|
551
556
|
googletagmanager: options.googletagmanager,
|
|
552
557
|
googleanalytics: options.googleanalytics,
|
|
558
|
+
vwo: options.vwo,
|
|
553
559
|
feedbackWidget: options.feedbackWidget,
|
|
554
560
|
pathJoin: upath.join,
|
|
555
561
|
mainOg: options.og || {}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
if vwo
|
|
2
|
+
link(rel="preconnect", href="https://dev.visualwebsiteoptimizer.com")
|
|
3
|
+
script#vwoCode(type="text/javascript").
|
|
4
|
+
|
|
5
|
+
window._vwo_code || (function() {
|
|
6
|
+
var account_id='!{ vwo.config.trackingId }',
|
|
7
|
+
version=2.1,
|
|
8
|
+
settings_tolerance=2000,
|
|
9
|
+
hide_element='body',
|
|
10
|
+
hide_element_style = 'opacity:0 !important;filter:alpha(opacity=0) !important;background:none !important',
|
|
11
|
+
f=false,w=window,d=document,v=d.querySelector('#vwoCode'),cK='_vwo_'+account_id+'_settings',cc={};try{var c=JSON.parse(localStorage.getItem('_vwo_'+account_id+'_config'));cc=c&&typeof c==='object'?c:{}}catch(e){}var stT=cc.stT==='session'?w.sessionStorage:w.localStorage;code={use_existing_jquery:function(){return typeof use_existing_jquery!=='undefined'?use_existing_jquery:undefined},library_tolerance:function(){return typeof library_tolerance!=='undefined'?library_tolerance:undefined},settings_tolerance:function(){return cc.sT||settings_tolerance},hide_element_style:function(){return'{'+(cc.hES||hide_element_style)+'}'},hide_element:function(){if(performance.getEntriesByName('first-contentful-paint')[0]){return''}return typeof cc.hE==='string'?cc.hE:hide_element},getVersion:function(){return version},finish:function(e){if(!f){f=true;var t=d.getElementById('_vis_opt_path_hides');if(t)t.parentNode.removeChild(t);if(e)(new Image).src='https://dev.visualwebsiteoptimizer.com/ee.gif?a='+account_id+e}},finished:function(){return f},addScript:function(e){var t=d.createElement('script');t.type='text/javascript';if(e.src){t.src=e.src}else{t.text=e.text}d.getElementsByTagName('head')[0].appendChild(t)},load:function(e,t){var i=this.getSettings(),n=d.createElement('script'),r=this;t=t||{};if(i){n.textContent=i;d.getElementsByTagName('head')[0].appendChild(n);if(!w.VWO||VWO.caE){stT.removeItem(cK);r.load(e)}}else{var o=new XMLHttpRequest;o.open('GET',e,true);o.withCredentials=!t.dSC;o.responseType=t.responseType||'text';o.onload=function(){if(t.onloadCb){return t.onloadCb(o,e)}if(o.status===200){_vwo_code.addScript({text:o.responseText})}else{_vwo_code.finish('&e=loading_failure:'+e)}};o.onerror=function(){if(t.onerrorCb){return t.onerrorCb(e)}_vwo_code.finish('&e=loading_failure:'+e)};o.send()}},getSettings:function(){try{var e=stT.getItem(cK);if(!e){return}e=JSON.parse(e);if(Date.now()>e.e){stT.removeItem(cK);return}return e.s}catch(e){return}},init:function(){if(d.URL.indexOf('__vwo_disable__')>-1)return;var e=this.settings_tolerance();w._vwo_settings_timer=setTimeout(function(){_vwo_code.finish();stT.removeItem(cK)},e);var t;if(this.hide_element()!=='body'){t=d.createElement('style');var i=this.hide_element(),n=i?i+this.hide_element_style():'',r=d.getElementsByTagName('head')[0];t.setAttribute('id','_vis_opt_path_hides');v&&t.setAttribute('nonce',v.nonce);t.setAttribute('type','text/css');if(t.styleSheet)t.styleSheet.cssText=n;else t.appendChild(d.createTextNode(n));r.appendChild(t)}else{t=d.getElementsByTagName('head')[0];var n=d.createElement('div');n.style.cssText='z-index: 2147483647 !important;position: fixed !important;left: 0 !important;top: 0 !important;width: 100% !important;height: 100% !important;background: white !important;';n.setAttribute('id','_vis_opt_path_hides');n.classList.add('_vis_hide_layer');t.parentNode.insertBefore(n,t.nextSibling)}var o='https://dev.visualwebsiteoptimizer.com/j.php?a='+account_id+'&u='+encodeURIComponent(d.URL)+'&vn='+version;if(w.location.search.indexOf('_vwo_xhr')!==-1){this.addScript({src:o})}else{this.load(o+'&x=true')}}};w._vwo_code=code;code.init();})();
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
if googleoptimize
|
|
2
|
-
|
|
3
|
-
// Google Optimize
|
|
4
|
-
script.
|
|
5
|
-
if (!{ JSON.stringify(googleoptimize.domains) }.indexOf(location.hostname) !== -1) {
|
|
6
|
-
(function (w, d, s, i) {
|
|
7
|
-
var f = d.getElementsByTagName(s)[0],
|
|
8
|
-
j = d.createElement(s);
|
|
9
|
-
j.async = true;
|
|
10
|
-
j.src = 'https://www.googleoptimize.com/optimize.js?id=' + i;
|
|
11
|
-
f.parentNode.insertBefore(j, f);
|
|
12
|
-
})( window, document, 'script', '!{ googleoptimize.id }' );
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
// End Google Optimize
|