aboutsummaryrefslogtreecommitdiff
path: root/site.tmpl
diff options
context:
space:
mode:
authorMitja Felicijan <mitja.felicijan@gmail.com>2019-10-30 00:32:50 +0100
committerMitja Felicijan <mitja.felicijan@gmail.com>2019-10-30 00:32:50 +0100
commit5471d723a030705c349c1633faf134b137bc9a5a (patch)
tree54942790b44a79e5a21bf95cb23da3de24cc660d /site.tmpl
parent408e00616d219601db45776409e54ffa579e431c (diff)
downloadmitjafelicijan.com-5471d723a030705c349c1633faf134b137bc9a5a.tar.gz
Added comment curation tool available at /comments.html
Diffstat (limited to 'site.tmpl')
-rw-r--r--site.tmpl136
1 files changed, 69 insertions, 67 deletions
diff --git a/site.tmpl b/site.tmpl
index 39e8c6c..c745997 100644
--- a/site.tmpl
+++ b/site.tmpl
@@ -1,6 +1,7 @@
1{{ define "header" }} 1{{ define "header" }}
2 <!doctype html> 2<!doctype html>
3 <html lang="en"> 3<html lang="en">
4
4 <head> 5 <head>
5 <meta charset="utf-8"> 6 <meta charset="utf-8">
6 <meta name="viewport" content="width=device-width, initial-scale=1.0"> 7 <meta name="viewport" content="width=device-width, initial-scale=1.0">
@@ -25,74 +26,75 @@
25 <meta name="twitter:card" content="summary"> 26 <meta name="twitter:card" content="summary">
26 <meta name="twitter:site" content="{{ html .Site.Other.Twitter_handle }}"> 27 <meta name="twitter:site" content="{{ html .Site.Other.Twitter_handle }}">
27 </head> 28 </head>
28 <body>
29 <main>
30{{ end }}
31 29
32{{ define "footer" }} 30 <body>
33 </main> 31 <main>
34 {{ template "ga" . }} 32 {{ end }}
33 {{ define "footer" }}
34 </main>
35 {{ template "ga" . }}
35 </body> 36 </body>
36 </html> 37
38</html>
37{{ end }} 39{{ end }}
38 40
39{{ define "navigation" }} 41{{ define "navigation" }}
40 <nav> 42<nav>
41 <a href="/">{{ html .Site.Other.Author }}</a> 43 <a href="/">{{ html .Site.Other.Author }}</a>
42 <a href="/curriculum-vitae.html">CV</a> 44 <a href="/curriculum-vitae.html">CV</a>
43 <a href="https://twitter.com/mitjafelicijan" target="_blank" rel="noopener nofollow">Twitter</a> 45 <a href="https://twitter.com/mitjafelicijan" target="_blank" rel="noopener nofollow">Twitter</a>
44 <a href="https://github.com/mitjafelicijan" target="_blank" rel="noopener nofollow">Github</a> 46 <a href="https://github.com/mitjafelicijan" target="_blank" rel="noopener nofollow">Github</a>
45 </nav> 47</nav>
46{{ end }} 48{{ end }}
47 49
48{{ define "author" }} 50{{ define "author" }}
49 <span>by {{ html .Site.Other.Author }}</span> 51<span>by {{ html .Site.Other.Author }}</span>
50{{ end }} 52{{ end }}
51 53
52{{define "date"}} 54{{define "date"}}
53 <time datetime="{{ .Format "2006-01-02T15:04:05Z07:00" }}"> 55<time datetime="{{ .Format "2006-01-02T15:04:05Z07:00" }}">
54 {{ .Format "2006, January 02" }} 56 {{ .Format "2006, January 02" }}
55 </time> 57</time>
56{{end}} 58{{end}}
57 59
58{{define "modified"}} 60{{define "modified"}}
59 <p class="modified">Modified on {{ .ModTime.Format "2006-01-02T15:04:05" }}</p> 61<p class="modified">Modified on {{ .ModTime.Format "2006-01-02T15:04:05" }}</p>
60{{end}} 62{{end}}
61 63
62{{ define "page" }} 64{{ define "page" }}
63 {{ template "header" . }} 65{{ template "header" . }}
64 {{ template "navigation" . }} 66{{ template "navigation" . }}
65 {{ .Content }} 67{{ .Content }}
66 {{ template "prism" . }} 68{{ template "prism" . }}
67 {{ template "mathjax" . }} 69{{ template "mathjax" . }}
68 {{ template "footer" . }} 70{{ template "footer" . }}
69{{ end }} 71{{ end }}
70 72
71{{ define "post" }} 73{{ define "post" }}
72 <article> 74<article>
73 <header> 75 <header>
74 <h1>{{ .Title }}</h1> 76 <h1>{{ .Title }}</h1>
75 {{ if eq .Other.Type "post" }} 77 {{ if eq .Other.Type "post" }}
76 <div class="info"> 78 <div class="info">
77 {{ template "date" .Date }} 79 {{ template "date" .Date }}
78 {{ template "author" . }} 80 {{ template "author" . }}
79 </div> 81 </div>
80 {{ end }} 82 {{ end }}
81 </header> 83 </header>
82 <section> 84 <section>
83 {{ .Content }} 85 {{ .Content }}
84 </section> 86 </section>
85 </article> 87</article>
86 88
87 {{ if eq .Other.Type "post" }} 89{{ if eq .Other.Type "post" }}
88 {{ template "comments" . }} 90{{ template "comments" . }}
89 {{ end }} 91{{ end }}
90 92
91 {{ template "modified" . }} 93{{ template "modified" . }}
92{{ end }} 94{{ end }}
93 95
94{{ define "mathjax" }} 96{{ define "mathjax" }}
95 <script type="text/x-mathjax-config"> 97<script type="text/x-mathjax-config">
96 MathJax.Hub.Config({ 98 MathJax.Hub.Config({
97 TeX: { equationNumbers: { autoNumber: "AMS" } }, 99 TeX: { equationNumbers: { autoNumber: "AMS" } },
98 tex2jax: { 100 tex2jax: {
@@ -101,38 +103,38 @@
101 processEscapes: true 103 processEscapes: true
102 }}); 104 }});
103 </script> 105 </script>
104 <script src="//cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_HTMLorMML" async="async"></script> 106<script src="//cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS-MML_HTMLorMML" async="async"></script>
105{{ end }} 107{{ end }}
106 108
107{{ define "ga" }} 109{{ define "ga" }}
108 <script async="async" src="https://www.googletagmanager.com/gtag/js?id=UA-12769079-10"></script> 110<script async="async" src="https://www.googletagmanager.com/gtag/js?id=UA-12769079-10"></script>
109 <script> 111<script>
110 window.dataLayer = window.dataLayer || []; 112 window.dataLayer = window.dataLayer || [];
111 function gtag() { 113 function gtag() {
112 dataLayer.push(arguments); 114 dataLayer.push(arguments);
113 } 115 }
114 gtag('js', new Date()); 116 gtag('js', new Date());
115 gtag('config', 'UA-12769079-10'); 117 gtag('config', 'UA-12769079-10');
116 </script> 118</script>
117{{ end }} 119{{ end }}
118 120
119{{ define "prism" }} 121{{ define "prism" }}
120 <script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.17.1/components/prism-core.min.js"></script> 122<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.17.1/components/prism-core.min.js"></script>
121 <script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.17.1/plugins/autoloader/prism-autoloader.min.js"></script> 123<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.17.1/plugins/autoloader/prism-autoloader.min.js"></script>
122{{ end }} 124{{ end }}
123 125
124{{ define "comments" }} 126{{ define "comments" }}
125 <div class="comments"> 127<div class="comments">
126 <h3>Comments</h3> 128 <h3>Comments</h3>
127 <div class="form"> 129 <div class="form">
128 <div><input id="name" placeholder="Your name" maxlength="20"></div> 130 <div><input id="name" placeholder="Your name" maxlength="20"></div>
129 <div><textarea id="comment" placeholder="Your comment" maxlength="500"></textarea></div> 131 <div><textarea id="comment" placeholder="Your comment" maxlength="500"></textarea></div>
130 <div><button id="submit">Post a comment</button></div> 132 <div><button id="submit">Post a comment</button></div>
131 </div>
132 <ul></ul>
133 </div> 133 </div>
134 <ul></ul>
135</div>
134 136
135 <script src="https://www.gstatic.com/firebasejs/7.2.1/firebase-app.js"></script> 137<script src="https://www.gstatic.com/firebasejs/7.2.1/firebase-app.js"></script>
136 <script src="https://www.gstatic.com/firebasejs/7.2.1/firebase-database.js"></script> 138<script src="https://www.gstatic.com/firebasejs/7.2.1/firebase-database.js"></script>
137 <script src="{{ .Rel "static/comments.js" }}?v={{ .ModTime.Format "20060102150405" }}" async></script> 139<script src="{{ .Rel "static/comments.js" }}?v={{ .ModTime.Format "20060102150405" }}" async></script>
138{{ end }} 140{{ end }}