Index

joshstock.in / dc2e4a6

Source for serving and static templating/compiling of https://joshstock.in.

Latest Commit

{#}TimeHashSubjectAuthor#(+)(-)GPG?
18216 Mar 2023 11:304508eabAdd Matomo heartbeat timerJosh Stockin110G

Blob @ joshstock.in / site / generators / head / scripts.py

application/x-python1492 bytesdownload raw
1import htmlgenerator as hg
2
3
4def run(data=None):
5 contents = [
6 # Theme switching script
7 hg.SCRIPT(type="text/javascript", src="/static/js/theme.js"),
8 # Banner scroll script
9 hg.SCRIPT(
10 type="text/javascript",
11 src="/static/js/banner_scroll.js",
12 defer=True,
13 ),
14 # Hyperlink anchors
15 hg.SCRIPT(
16 type="text/javascript",
17 src="/static/js/anchors.js",
18 ),
19 # Tracking script
20 hg.SCRIPT(
21 hg.mark_safe(
22 """var _paq = window._paq = window._paq || [];
23_paq.push(["setDocumentTitle", document.domain + "/" + document.title]);
24_paq.push(["setCookieDomain", "*.*.joshstock.in"]);
25_paq.push(["setDomains", ["*.*.joshstock.in"]]);
26_paq.push(['trackPageView']);
27_paq.push(['enableHeartBeatTimer', 30]);
28_paq.push(['enableLinkTracking']);
29(function() {
30 var u="//analytics.joshstock.in/";
31 _paq.push(['setTrackerUrl', u+'matomo.php']);
32 _paq.push(['setSiteId', '1']);
33 var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
34 g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
35})();""",
36 ),
37 ),
38 hg.NOSCRIPT(
39 hg.P(
40 hg.IMG(
41 src="//analytics.joshstock.in/matomo.php?idsite=1&rec=1",
42 border="0",
43 alt="",
44 ),
45 ),
46 ),
47 ]
48
49 return contents
50