summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2015-06-20 00:42:47 +0200
committerDimitri Sokolyuk <demon@dim13.org>2015-06-20 00:42:47 +0200
commited1c9a830e54d040a88e4d574c192153cedb2f6d (patch)
tree9e41866df67660ba479ff83f0cafb4f4b75c740f
parent4718ebd990396ffef022743888faf19977db09ce (diff)
Roll back list template
-rw-r--r--Makefile2
-rw-r--r--template/article.tmpl6
-rw-r--r--template/index.tmpl9
-rw-r--r--template/root.tmpl11
4 files changed, 15 insertions, 13 deletions
diff --git a/Makefile b/Makefile
index a14800d..6713884 100644
--- a/Makefile
+++ b/Makefile
@@ -6,6 +6,8 @@ clean:
install:
install blog /usr/local/bin/
+ install template/*.tmpl /var/www/htdocs/template/
+ install static/style.css /var/www/htdocs/static/
restart:
/etc/rc.d/blog restart
diff --git a/template/article.tmpl b/template/article.tmpl
index 426ce9f..7d38dda 100644
--- a/template/article.tmpl
+++ b/template/article.tmpl
@@ -8,7 +8,11 @@
{{with .Related}}
<section>
<h3>Related articles</h3>
- {{template "list" .}}
+ <ul>
+ {{range .}}
+ <li><a href="{{.Path}}">{{.Title}}</a></li>
+ {{end}}
+ </ul>
</section>
{{end}}
{{end}}
diff --git a/template/index.tmpl b/template/index.tmpl
index 2e7f2cc..843a791 100644
--- a/template/index.tmpl
+++ b/template/index.tmpl
@@ -5,6 +5,13 @@
{{define "content"}}
<section>
<h2>{{template "title"}}</h2>
- {{template "list" .Data}}
+ <dl>
+ {{range .Data}}
+ <dt><a href="{{.Path}}">{{.Title}}</a></dt>
+ <dd>{{template "time" .Time}}
+ {{with .Tags}}<div class="tags">{{range .}}{{.}} {{end}}</div>{{end}}
+ </dd>
+ {{end}}
+ </dl>
</section>
{{end}}
diff --git a/template/root.tmpl b/template/root.tmpl
index 8bebe8e..b9f76c6 100644
--- a/template/root.tmpl
+++ b/template/root.tmpl
@@ -80,14 +80,3 @@
{{define "time"}}
<time datetime="{{.Format "2006-01-02 15:04"}}">{{.Format "2 January 2006"}}</time>
{{end}}
-
-{{define "list"}}
-<dl>
-{{range .}}
- <dt><a href="{{.Path}}">{{.Title}}</a></dt>
- <dd>{{template "time" .Time}}
- {{with .Tags}}<div class="tags">{{range .}}{{.}} {{end}}</div>{{end}}
- </dd>
-{{end}}
-</dl>
-{{end}}