summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2015-06-14 14:11:44 +0200
committerDimitri Sokolyuk <demon@dim13.org>2015-06-14 14:11:44 +0200
commit74e2a1d1304a8d81ade6266f54fba8d50adddc28 (patch)
tree985c54aa002784ea932ae8e81aeafc92f34caa74
parent9fef1f3680590b47d0e91b4d361509a2c65d0f34 (diff)
Use dl for index, move related into article
-rw-r--r--static/style.css13
-rw-r--r--template/article.tmpl15
-rw-r--r--template/doc.tmpl2
-rw-r--r--template/index.tmpl21
-rw-r--r--template/root.tmpl17
5 files changed, 30 insertions, 38 deletions
diff --git a/static/style.css b/static/style.css
index 2dbadf9..0ff6764 100644
--- a/static/style.css
+++ b/static/style.css
@@ -27,16 +27,15 @@ time, address, #tags {
font-size: smaller;
color: #999;
}
-#index td:nth-child(odd) {
- text-align: right;
+dd {
+ padding-bottom: 1em;
}
-#index td {
- vertical-align: top;
- padding: 0.5ex;
-}
-header a, aside a {
+header a, aside a, section a, footer a {
color: #F50;
}
+section li {
+ list-style-type: circle;
+}
a {
text-decoration: none;
color: #05A;
diff --git a/template/article.tmpl b/template/article.tmpl
index eaa936a..a57f084 100644
--- a/template/article.tmpl
+++ b/template/article.tmpl
@@ -2,6 +2,17 @@
{{define "title"}}{{.Doc.Title}}{{end}}
{{define "content"}}
- {{template "doc" .Doc}}
+ {{with .Doc}}
+ {{template "doc" .}}
+ {{with .Related}}
+ <section>
+ <h3>Related articles</h3>
+ <ul>
+ {{range .}}
+ <li><a href="{{.Path}}">{{.Title}}</a></li>
+ {{end}}
+ </ul>
+ </section>
+ {{end}}
+ {{end}}
{{end}}
-
diff --git a/template/doc.tmpl b/template/doc.tmpl
index 8d1b2c9..5f6c4df 100644
--- a/template/doc.tmpl
+++ b/template/doc.tmpl
@@ -1,7 +1,6 @@
{{/* This doc template is given to the present tool to format articles. */}}
{{define "root"}}
-
{{with .Subtitle}}<h3>{{.}}</h3>{{end}}
{{if .Doc | sectioned}}
{{range .Sections}}
@@ -14,7 +13,6 @@
{{end}}
{{end}}
{{end}}
-
{{end}}
{{define "TOC"}}
diff --git a/template/index.tmpl b/template/index.tmpl
index 433ac2c..a1ac5a0 100644
--- a/template/index.tmpl
+++ b/template/index.tmpl
@@ -2,17 +2,12 @@
{{define "title"}}Article index{{end}}
{{define "content"}}
-
- <h3>{{template "title"}}</h3>
-
- <table id="index">
- {{range .Data}}
- <tr>
- <td><time datetime="{{.Time.Format "2006-01-02 15:04"}}">{{.Time.Format "2 January 2006"}}</time></td>
- <td><a href="{{.Path}}">{{.Title}}</a>
- {{with .Tags}}<br><span id="tags">{{range .}}{{.}} {{end}}</span>{{end}}</td>
- </tr>
- {{end}}
- </table>
-
+ <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>
{{end}}
diff --git a/template/root.tmpl b/template/root.tmpl
index 5794c37..461c82f 100644
--- a/template/root.tmpl
+++ b/template/root.tmpl
@@ -2,7 +2,6 @@
{{define "google"}}
<meta name="google-site-verification" content="3cwuN4OwVfNZEGTw5Q9UotI2AJCTzr8F7QB8uhtfAWo">
-
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
@@ -28,7 +27,7 @@
<aside>
<header>
- <h1><a href="{{.BasePath}}/">dim-i-tri&nbsp;.&nbsp;org</a></h1>
+ <h1><a href="{{.BasePath}}/">dim-i-tri's blog</a></h1>
</header>
{{with .Doc}}
@@ -36,27 +35,17 @@
<h4>Previous article</h4>
<p><a href="{{.Path}}">{{.Title}}</a></p>
{{end}}
-
{{with .Newer}}
<h4>Next article</h4>
<p><a href="{{.Path}}">{{.Title}}</a></p>
{{end}}
-
- {{with .Related}}
- <h4>Related articles</h4>
- <ul>
- {{range .}}
- <li><a href="{{.Path}}">{{.Title}}</a></li>
- {{end}}
- </ul>
- {{end}}
{{end}}
<h4>Links</h4>
<ul>
<li><a href="{{.BasePath}}/index">Blog Index</a></li>
- <li><a href="/cgi-bin/cvsweb">CVS Repository</a></li>
- <li><a href="/cgi-bin/cgit.cgi">Git Repository</a></li>
+ <li><a href="/cgi-bin/cvsweb">CVS</a> (C code)</li>
+ <li><a href="/cgi-bin/cgit.cgi">Git</a> (Go code)</li>
<li><a href="//github.com/dim13">GitHub</a></li>
<li><a href="ftp://ftp.dim13.org/pub/">Public FTP</a></li>
<li><a href="{{.BasePath}}/Who-am-I">Who am I</a></li>