Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/jbub/ghostwriter.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuraj Bubniak <juraj.bubniak@exponea.com>2018-08-30 18:01:15 +0300
committerJuraj Bubniak <juraj.bubniak@exponea.com>2018-08-30 18:01:15 +0300
commit369507039ce5140542b5cba8c1e0f4a3ea270b11 (patch)
tree3eae18d1675af60ba8eb35feaaa38f888e60b53f
parent2340a01fea08ecfff62ee22551741180862156ce (diff)
Add exponea support.
-rw-r--r--README.md4
-rw-r--r--exampleSite/config.toml4
-rw-r--r--layouts/partials/exponea.html12
-rw-r--r--layouts/partials/header.html1
4 files changed, 21 insertions, 0 deletions
diff --git a/README.md b/README.md
index 73aad5c..5c2e33e 100644
--- a/README.md
+++ b/README.md
@@ -82,6 +82,10 @@ disqusShortname = "XXX"
dateFormat = "Mon, Jan 2, 2006"
highlightJsUrl = ""
highlightJsLocalUrl = ""
+ exponeaJsUrl = ""
+ exponeaTarget = ""
+ exponeaToken = ""
+ exponeaTrackVisits = false
[Permalinks]
post = "/:year/:month/:day/:filename/"
diff --git a/exampleSite/config.toml b/exampleSite/config.toml
index 5b0c218..ad8b53f 100644
--- a/exampleSite/config.toml
+++ b/exampleSite/config.toml
@@ -42,6 +42,10 @@ googleAnalytics = "XXX"
dateFormat = "Mon, Jan 2, 2006"
highlightJsUrl = ""
highlightJsLocalUrl = ""
+ exponeaJsUrl = ""
+ exponeaTarget = ""
+ exponeaToken = ""
+ exponeaTrackVisits = false
[Permalinks]
post = "/:year/:month/:day/:filename/"
diff --git a/layouts/partials/exponea.html b/layouts/partials/exponea.html
new file mode 100644
index 0000000..357c213
--- /dev/null
+++ b/layouts/partials/exponea.html
@@ -0,0 +1,12 @@
+{{ if .Site.Params.exponeaJsUrl }}
+ <script>(function(d,b){if(!d.exponea){var a=function(a,g){function k(c){return function(){var e=arguments;""==a&&"initialize"==c&&e&&e[0].modify&&e[0].modify.overlay&&"loading"==b.readyState&&(b.write('<div id="__inf__overlay__" style="position:absolute;background:#fff;left:0;top:0;width:100%;height:100%;z-index:1000000"></div>'),setTimeout(function(){var a=b.getElementById("__inf__overlay__");a&&b.body.removeChild(a);res.__=!0},e[0].modify.delay||500));d.exponea._.push([a+c,arguments])}}var h=g.split(" "),f,c;res={_:[]};for(c=0;c<h.length;c++)f=h[c],res[f]=k(f);return res};d.exponea=a("","initialize identify update track trackLink trackEnhancedEcommerce getHtml showHtml showBanner showForm ping getAbTest");d.exponea.notifications=a("notifications.","isAvailable isSubscribed subscribe unsubscribe");var a=b.createElement("script"),g="https:"===b.location.protocol?"https:":"http:";a.type="text/javascript";a.async=!0;a.src=g+"{{ .Site.Params.exponeaJsUrl }}";b.getElementsByTagName("head")[0].appendChild(a)}})(window,document);</script>
+ <script type="text/javascript">
+ exponea.initialize({
+ "target": "{{ .Site.Params.exponeaTarget }}",
+ "token": "{{ .Site.Params.exponeaToken }}",
+ "track": {
+ "visits": {{ if .Site.Params.exponeaTrackVisits }}true{{ else }}false{{ end }}
+ }
+ });
+ </script>
+{{ end }} \ No newline at end of file
diff --git a/layouts/partials/header.html b/layouts/partials/header.html
index 8ddb315..64412a0 100644
--- a/layouts/partials/header.html
+++ b/layouts/partials/header.html
@@ -18,6 +18,7 @@
<link href="{{ .RSSLink }}" rel="alternate" type="application/rss+xml">
{{ end }}
{{ partial "extra-in-head.html" . }}
+ {{ partial "exponea.html" . }}
</head>
<body>
{{ template "_internal/google_analytics.html" . }}