Index

joshstock.in / 971e239

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

Latest Commit

{#}TimeHashSubjectAuthor#(+)(-)GPG?
15814 Jan 2023 23:375aaa26aWebsite rewriteJosh Stockin1480G

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

application/x-python1451 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(['enableLinkTracking']);
28(function() {
29 var u="//analytics.joshstock.in/";
30 _paq.push(['setTrackerUrl', u+'matomo.php']);
31 _paq.push(['setSiteId', '1']);
32 var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
33 g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
34})();""",
35 ),
36 ),
37 hg.NOSCRIPT(
38 hg.P(
39 hg.IMG(
40 src="//analytics.joshstock.in/matomo.php?idsite=1&rec=1",
41 border="0",
42 alt="",
43 ),
44 ),
45 ),
46 ]
47
48 return contents
49