1
0
mirror of https://github.com/funkypenguin/geek-cookbook/ synced 2025-12-13 17:56:26 +00:00

Setup preview branch (#88)

* Setup preview branch

* Add rightmessage js

* Actually calling the js will help

* Fussy javascript

* Test embedded message after recipe

* Update main.html
This commit is contained in:
David Young
2020-05-24 10:11:23 +12:00
committed by GitHub
parent f14c7a080a
commit 30f54e2c81
3 changed files with 51 additions and 3 deletions

View File

@@ -8,8 +8,8 @@ edit_uri: 'edit/master/manuscript/'
# strict: true
# Repository
repo_name: 'funkypenguin/geek-cookbook'
repo_url: 'https://github.com/funkypenguin/geek-cookbook'
repo_name: 'geek-cookbook/yes-this-is-it'
repo_url: 'https://github.com/geek-cookbook/yes-this-is-it'
# Set this to "manuscript" so that we can produce leanpub content
docs_dir: 'manuscript'

View File

@@ -25,3 +25,49 @@
{% endblock %}
{% block analytics %}
<!-- RightMessage -->
<script type="text/javascript">
(function(p, a, n, d, o, b, c) {
o = n.createElement('script'); o.type = 'text/javascript'; o.async = true; o.src = 'https://tb.rightmessage.com/'+p+'.js';
b = n.getElementsByTagName('script')[0]; d = function(h, u, i) { var c = n.createElement('style'); c.id = 'rmcloak'+i;
c.type = 'text/css'; c.appendChild(n.createTextNode('.rmcloak'+h+'{visibility:hidden}.rmcloak'+u+'{display:none}'));
b.parentNode.insertBefore(c, b); return c; }; c = d('', '-hidden', ''); d('-stay-invisible', '-stay-hidden', '-stay');
setTimeout(o.onerror = function() { c.parentNode && c.parentNode.removeChild(c); }, a); b.parentNode.insertBefore(o, b);
})('1802694484', 20000, document);
</script>
{% set analytics = config.google_analytics %}
<link rel="preconnect dns-prefetch" href="https://www.google-analytics.com">
<script type="application/javascript">
window.ga = window.ga || function() {
(ga.q = ga.q || []).push(arguments)
}
ga.l = +new Date
/* Set up integration and send page view */
ga("create", "{{ analytics[0] }}", "{{ analytics[1] }}")
ga("set", "anonymizeIp", true)
ga("send", "pageview")
/* Register handler to log search on blur */
document.addEventListener("DOMContentLoaded", function() {
if (document.forms.search) {
var query = document.forms.search.query
query.addEventListener("blur", function() {
if (this.value) {
var path = document.location.pathname;
ga("send", "pageview", path + "?q=" + this.value)
}
})
}
})
/* Send page view on document switch (instant loading, custom event) */
document.addEventListener("DOMContentSwitch", function() {
ga("send", "pageview")
})
</script>
<script async src="https://www.google-analytics.com/analytics.js"></script>
{% endblock %}

View File

@@ -6,6 +6,8 @@ Did you receive excellent service? Want to make your waiter happy? (_..and suppo
Want to know now when this recipe gets updated, or when future recipes are added? Subscribe to the [RSS feed](https://mastodon.social/@geekcookbook_changes.atom), or leave your email address below, and we'll keep you updated. (*double-opt-in, no monkey business, no spam either - check the [archive](https://us16.campaign-archive.com/home/?u=a1d9cee4402be76497a2baf49&id=10e284530a) for proof!*)
<div class="rm-area-after-recipe"></div>
<!-- Begin Mailchimp Signup Form -->
<div id="mailchimp">
<form action="https://funkypenguin.us16.list-manage.com/subscribe/post?u=a1d9cee4402be76497a2baf49&amp;id=10e284530a" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>