summaryrefslogtreecommitdiff
path: root/template/root.tmpl
blob: a9b6a90f0d60170cace065b0c583188fa718c8d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
{{/* This template is combined with other templates to render blog pages. */}}

{{define "ga"}}
<script type="text/javascript" async>
	(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
	(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
	m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
	})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
	ga('create', 'UA-22272807-1', 'auto');
	ga('send', 'pageview');
</script>
{{end}}

{{define "aside"}}
<aside>
	<header>
	<h1><a href="{{.BasePath}}/">dim13·blog</a></h1>
	</header>

	{{with .Doc}}
		{{with .Older}}
			<h4>Previous article</h4>
			<p><a href="{{.Path}}">{{.Title}}</a></p>
		{{end}}
		{{with .Newer}}
			<h4>Next article</h4>
			<p><a href="{{.Path}}">{{.Title}}</a></p>
		{{end}}
	{{end}}

	<h4>Links</h4>
	<ul>
		<li><a href="{{.BasePath}}/index">Blog Index</a></li>
		<li><a href="//github.com/dim13">GitHub</a></li>
		<li><a href="/cgi-bin/cgit.cgi">Local Git</a></li>
		<li><a href="ftp://ftp.dim13.org/pub/">Public FTP</a></li>
		<li><a href="{{.BasePath}}/Who-am-I">Who am I</a></li>
	</ul>

	<p><img src="avatar/cube.jpg" alt="avatar"></p>
</aside>
{{end}}

{{define "root" -}}
<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title>{{template "title" .}}</title>
	<link rel="stylesheet" type="text/css" href="/static/fonts.css">
	<link rel="stylesheet" type="text/css" href="/static/style.css">
	<link rel="alternate" type="application/atom+xml" title="Atom Feed" href="/feed.atom">
	<meta name="google-site-verification" content="3cwuN4OwVfNZEGTw5Q9UotI2AJCTzr8F7QB8uhtfAWo">
	<meta name="viewport" content="width=device-width, initial-scale=1">
{{template "ga"}}
</head>
<body>
{{template "aside" .}}
{{template "content" .}}
</body>
</html>
{{end}}

{{define "doc"}}
	<article>
	<header>
		<h2><a href="{{.Path}}">{{.Title}}</a></h2>
		<p>{{template "time" .Time}}</p>
	</header>
	{{.HTML}}
	{{with .Authors}}
	<footer>
		<address>By {{authors .}}</address>
	</footer>
	{{end}}
	</article>
{{end}}

{{define "time"}}
<time datetime="{{.Format "2006-01-02 15:04"}}">{{.Format "2 January 2006"}}</time>
{{end}}