aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2016-08-17 05:52:10 +0200
committerDimitri Sokolyuk <demon@dim13.org>2016-08-17 05:52:10 +0200
commit4b0a84280ea990cbe1219567a80a61a1008d8920 (patch)
tree43f63e6e0e1c00453a409d0466b8d922e5cd7cad
parent1a5503aabaa62f2921bc5751aa15b8a16583d2b5 (diff)
parent910f3461f9bf7b8f032e0681dc2675d06cc99296 (diff)
Merge branch 'master' of dim13.org:gowiki
-rw-r--r--.dockerignore1
-rw-r--r--.gitignore1
-rw-r--r--Makefile2
-rw-r--r--tmpl/edit3
-rw-r--r--tmpl/index1
-rw-r--r--tmpl/root5
-rw-r--r--tmpl/view3
7 files changed, 11 insertions, 5 deletions
diff --git a/.dockerignore b/.dockerignore
new file mode 100644
index 0000000..6b8710a
--- /dev/null
+++ b/.dockerignore
@@ -0,0 +1 @@
+.git
diff --git a/.gitignore b/.gitignore
index 8eebda4..e9f83c9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
cert/*
data/*
gowiki
+*.swp
diff --git a/Makefile b/Makefile
index c2b90df..d4ace71 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
TAG = gowiki
-build:
+build: clean
docker build -t ${TAG} --rm --no-cache .
push: build
diff --git a/tmpl/edit b/tmpl/edit
index 2034f47..f4c5f2c 100644
--- a/tmpl/edit
+++ b/tmpl/edit
@@ -7,3 +7,6 @@
<input type="reset" value="Reset">
</form>
{{end}}
+{{define "action"}}
+<a href="/del/{{.Title}}" title="delete {{.Title}}"><i class="fa fa-trash"></i></a>
+{{end}}
diff --git a/tmpl/index b/tmpl/index
index e69a07d..7979e14 100644
--- a/tmpl/index
+++ b/tmpl/index
@@ -15,3 +15,4 @@
{{end}}
</table>
{{end}}
+{{define "action"}}{{end}}
diff --git a/tmpl/root b/tmpl/root
index 093ad19..c357ad1 100644
--- a/tmpl/root
+++ b/tmpl/root
@@ -10,10 +10,7 @@
<body>
<nav>
<span>{{template "title" .}}</span>
- {{with .Title -}}
- <a href="/edit/{{.}}" title="edit {{.}}"><i class="fa fa-pencil"></i></a>
- <!--a href="/del/{{.}}" title="delete {{.}}"><i class="fa fa-trash"></i></a-->
- {{- end}}
+ {{template "action" .}}
<a href="/" title="home"><i class="fa fa-home"></i></a>
<a href="/index" title="index"><i class="fa fa-list"></i></a>
</nav>
diff --git a/tmpl/view b/tmpl/view
index 68a4c4f..c816e34 100644
--- a/tmpl/view
+++ b/tmpl/view
@@ -1,2 +1,5 @@
{{define "title"}}{{.Title}}{{end}}
{{define "content"}}{{.HTML}}{{end}}
+{{define "action"}}
+<a href="/edit/{{.Title}}" title="edit {{.Title}}"><i class="fa fa-pencil"></i></a>
+{{end}}