aboutsummaryrefslogtreecommitdiff
path: root/tmpl
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2016-02-16 18:43:22 +0100
committerDimitri Sokolyuk <demon@dim13.org>2016-02-16 18:43:22 +0100
commit8bf5d9d2c82560c81be6809522215bded0cf9911 (patch)
tree82df16f1e2b3d130b63a910df55e22a124d56c5b /tmpl
Inital import
Diffstat (limited to 'tmpl')
-rw-r--r--tmpl/doc23
-rw-r--r--tmpl/edit9
-rw-r--r--tmpl/index8
-rw-r--r--tmpl/root27
-rw-r--r--tmpl/view4
5 files changed, 71 insertions, 0 deletions
diff --git a/tmpl/doc b/tmpl/doc
new file mode 100644
index 0000000..f4f1dd3
--- /dev/null
+++ b/tmpl/doc
@@ -0,0 +1,23 @@
+{{define "link"}}
+ <a href="{{.}}">{{.}}</a>
+{{end}}
+
+{{define "img"}}
+ <img src="{{.}}">
+{{end}}
+
+{{define "par"}}
+ <p>{{.}}</p>
+{{end}}
+
+{{define "pre"}}
+ <pre>{{.}}</pre>
+{{end}}
+
+{{define "list"}}
+<ul>
+ {{range .}}
+ <li>{{.}}</li>
+ {{end}}
+</ul>
+{{end}}
diff --git a/tmpl/edit b/tmpl/edit
new file mode 100644
index 0000000..16b7846
--- /dev/null
+++ b/tmpl/edit
@@ -0,0 +1,9 @@
+{{define "title"}}Editing {{.Title}}{{end}}
+{{define "content"}}
+<form action="/save/{{.Title}}" method="POST">
+<textarea name="body" rows="20" cols="80">{{printf "%s" .Body}}</textarea>
+<br>
+<input type="submit" value="Save">
+<input type="reset" value="Reset">
+</form>
+{{end}}
diff --git a/tmpl/index b/tmpl/index
new file mode 100644
index 0000000..d95deca
--- /dev/null
+++ b/tmpl/index
@@ -0,0 +1,8 @@
+{{define "title"}}Index{{end}}
+{{define "content"}}
+<ul>
+{{range .Pages}}
+<li><a href="/view/{{.}}">{{.}}</a></li>
+{{end}}
+</ul>
+{{end}}
diff --git a/tmpl/root b/tmpl/root
new file mode 100644
index 0000000..ae31e36
--- /dev/null
+++ b/tmpl/root
@@ -0,0 +1,27 @@
+{{define "root"}}
+<!DOCTYPE html>
+<html>
+<head>
+ <title>{{template "title" .}}</title>
+ <link href='http://fonts.googleapis.com/css?family=Raleway|Anonymous+Pro' rel='stylesheet' type='text/css'>
+ <style>
+ body {
+ font-family: 'Raleway', sans-serif;
+ margin: 5% 10%;
+ }
+ pre {
+ font-family: 'Anonymous Pro', monospace;
+ }
+ </style>
+</head>
+<body>
+<section>
+<header>
+<h1>{{template "title" .}}</h1>
+<nav><a href="/">root</a> <a href="/index">index</a> {{with .Title}}<a href="/edit/{{.}}">edit</a>{{end}}</nav>
+</header>
+{{template "content" .}}
+</section>
+</body>
+</html>
+{{end}}
diff --git a/tmpl/view b/tmpl/view
new file mode 100644
index 0000000..24d9b55
--- /dev/null
+++ b/tmpl/view
@@ -0,0 +1,4 @@
+{{define "title"}}{{.Title}}{{end}}
+{{define "content"}}
+{{.HTML}}
+{{end}}