aboutsummaryrefslogtreecommitdiff
path: root/example-site/tpl/base.md
blob: 97842c1d0c88aa0e32a46858bd2ec427edf1c6e8 (plain) (blame)
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
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">

  <link id="maincss" rel="stylesheet" href="/static/style.css" defer>

  <meta name="viewport" content="width=device-width, initial-scale=1.0">

  {{if .AuthorName }}
    <meta name="author" content="{{.AuthorName}}">
  {{else if .Global.App.Author.Name }}
    <meta name="author" content="{{.Global.App.Author.Name}}">
  {{else}}
  {{end}}

{{if .Title}}
  <title>{{.Title}}</title>
{{else}}
  <title>Please change me!</title>
{{end}}

{{if .Description}}
  <meta name="description" content="{{.Description}}">
{{else}}
  <meta name="description" content="Draft and or Preview page. Default Description.">
{{end}}

</head>

<body>

{{if .Description}}{{else}}
  <h1>
    <span style="color: red;">
    This is a draft, preview or otherwise unfinished page.
    </span>
  </h1>
{{end}}

{{block "nav" .}}
<nav>
	| <a href="/">Home</a> |
	<div style="display: block; float: right;">
	| <a href="#">Git</a>
	{{if .Vars.LoggedIn}}
<span id="edit">| <a href="#" onClick="editThisPage()">Edit</a></span>
	| <a href="/dashboard">Dashboard</a>
	| <a href="/logout">Logout</a> |
	{{else}}
	| <a href="/login">Login</a>
	{{end}}
	</div>
</nav>
{{end}}

{{.RenderBody}}


{{if .Vars.LoggedIn}}
<script>
function editThisPage()
{
	if(window.location.pathname == "/") {
		window.location = "/edit/index";
		return;
	}
	if(window.location.pathname == "/dashboard") {
		window.location = "/edit/tpl/dashboard";
		return;
	}
	window.location = "/edit/" + window.location.pathname;
}
</script>
{{end}}
</body>