summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2015-06-19 16:17:17 +0200
committerDimitri Sokolyuk <demon@dim13.org>2015-06-19 16:17:17 +0200
commit09f85ffd3eb84c605ef0b851a054fce310b9c8cf (patch)
tree0c9915e59ffc12ff6c23329e43f44fa20e88eef0
parenta344cef5099d4bf5416cec9601557e44ba2343b7 (diff)
Update templates
-rw-r--r--static/style.css15
-rw-r--r--template/article.tmpl7
-rw-r--r--template/doc.tmpl2
-rw-r--r--template/home.tmpl1
-rw-r--r--template/index.tmpl11
-rw-r--r--template/root.tmpl21
6 files changed, 33 insertions, 24 deletions
diff --git a/static/style.css b/static/style.css
index 0ff6764..793a6bd 100644
--- a/static/style.css
+++ b/static/style.css
@@ -23,22 +23,19 @@ pre {
img, pre {
border-radius: 1ex;
}
-time, address, #tags {
+time, address, .tags {
font-size: smaller;
color: #999;
}
dd {
padding-bottom: 1em;
}
-header a, aside a, section a, footer a {
- color: #F50;
-}
-section li {
- list-style-type: circle;
+article a {
+ color: #05A;
}
-a {
+a, header a {
+ color: #F50;
text-decoration: none;
- color: #05A;
}
aside {
float: right;
@@ -62,7 +59,7 @@ aside li {
article {
margin-bottom: 3em;
}
-#figcaption {
+.figcaption {
font-style: italic;
margin-bottom: 1em;
}
diff --git a/template/article.tmpl b/template/article.tmpl
index a57f084..426ce9f 100644
--- a/template/article.tmpl
+++ b/template/article.tmpl
@@ -1,17 +1,14 @@
{{/* This file is combined with the root.tmpl to display a single article. */}}
{{define "title"}}{{.Doc.Title}}{{end}}
+
{{define "content"}}
{{with .Doc}}
{{template "doc" .}}
{{with .Related}}
<section>
<h3>Related articles</h3>
- <ul>
- {{range .}}
- <li><a href="{{.Path}}">{{.Title}}</a></li>
- {{end}}
- </ul>
+ {{template "list" .}}
</section>
{{end}}
{{end}}
diff --git a/template/doc.tmpl b/template/doc.tmpl
index 5f6c4df..3319bd6 100644
--- a/template/doc.tmpl
+++ b/template/doc.tmpl
@@ -61,7 +61,7 @@
{{end}}
{{define "caption"}}
- <p id="figcaption">{{style .Text}}</p>
+ <p class="figcaption">{{style .Text}}</p>
{{end}}
{{define "iframe"}}
diff --git a/template/home.tmpl b/template/home.tmpl
index 5b6867d..31181fb 100644
--- a/template/home.tmpl
+++ b/template/home.tmpl
@@ -1,6 +1,7 @@
{{/* This file is combined with the root.tmpl to display the blog home page. */}}
{{define "title"}}dim-i-tri{{end}}
+
{{define "content"}}
{{range .Data}}
{{template "doc" .}}
diff --git a/template/index.tmpl b/template/index.tmpl
index a1ac5a0..d74f415 100644
--- a/template/index.tmpl
+++ b/template/index.tmpl
@@ -1,13 +1,10 @@
{{/* This file is combined with the root.tmpl to display the blog index. */}}
{{define "title"}}Article index{{end}}
+
{{define "content"}}
+<section>
<h3>{{template "title"}}</h3>
- <dl>
- {{range .Data}}
- <dt><time datetime="{{.Time.Format "2006-01-02 15:04"}}">{{.Time.Format "2 January 2006"}}</time></dt>
- <dd><a href="{{.Path}}">{{.Title}}</a>
- {{with .Tags}}<br><span id="tags">{{range .}}{{.}} {{end}}</span>{{end}}</dd>
- {{end}}
- </dl>
+ {{template "list" .Data}}
+</section>
{{end}}
diff --git a/template/root.tmpl b/template/root.tmpl
index 461c82f..8bebe8e 100644
--- a/template/root.tmpl
+++ b/template/root.tmpl
@@ -18,7 +18,9 @@
<head>
<meta charset="UTF-8">
<title>{{template "title" .}}</title>
- <link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Abel|Raleway|Anonymous+Pro">
+ <link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Abel">
+ <link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Raleway">
+ <link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Anonymous+Pro">
<link rel="stylesheet" type="text/css" href="/static/style.css">
<link rel="alternate" type="application/atom+xml" title="Atom Feed" href="/feed.atom">
{{template "google"}}
@@ -64,7 +66,7 @@
<article>
<header>
<h2><a href="{{.Path}}">{{.Title}}</a></h2>
- <p><time datetime="{{.Time.Format "2006-01-02 15:04"}}">{{.Time.Format "2 January 2006"}}</time></p>
+ <p>{{template "time" .Time}}</p>
</header>
{{.HTML}}
{{with .Authors}}
@@ -74,3 +76,18 @@
{{end}}
</article>
{{end}}
+
+{{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}}