summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2017-12-26 13:04:18 +0100
committerDimitri Sokolyuk <demon@dim13.org>2017-12-26 13:04:18 +0100
commitc3e64686145b5b2c31e72a182b3f8ff6c3ae3ef9 (patch)
tree219a56b651b50f7021e27b1cbc38360f8b876a0e
parentaa3789452fd34c174268aaaa088e1fd97601a2d3 (diff)
Switch to bootstrap
-rw-r--r--static/style.css70
-rw-r--r--template/article.tmpl12
-rw-r--r--template/doc.tmpl16
-rw-r--r--template/home.tmpl4
-rw-r--r--template/index.tmpl23
-rw-r--r--template/root.tmpl107
-rw-r--r--vendor/golang.org/x/tools/README.md27
7 files changed, 136 insertions, 123 deletions
diff --git a/static/style.css b/static/style.css
index 9774886..d0031dd 100644
--- a/static/style.css
+++ b/static/style.css
@@ -1,69 +1,47 @@
body {
- margin: 5% 10%;
color: #222;
- padding: 1ex 1em;
font-family: 'Abel', sans-serif;
}
-h1, h2, h3, h4, header, footer {
+h1, h2, h3, h4, h5, h6, header, footer, .navbar-brand {
font-family: 'Raleway', sans-serif;
- margin: 2em 0 1em 0;
}
-h1, h2 {
+h1, h2, .navbar-brand {
text-shadow: 1px 1px #CCC;
}
pre, code, kbd {
font-family: 'Anonymous Pro', monospace;
}
+a {
+ color: #F50;
+}
+a:hover {
+ color: #05A;
+}
pre {
line-height: 120%;
- font-size: smaller;
- border: thin solid #CDE;
overflow: auto;
+ border: thin solid #CDE;
padding: 1ex 2ex;
}
-img, pre {
- border-radius: 1ex;
-}
-time, address, .tags {
- font-size: smaller;
- color: #999;
-}
-dd {
- padding-bottom: 1em;
-}
-article a {
- color: #05A;
-}
-a, header a {
- color: #F50;
- text-decoration: none;
-}
-aside {
- float: right;
- padding-left: 1em;
- margin: 0 0 1em 2em;
- width: 10em;
- border-left: thin solid #999;
- color: #555;
-
-}
-aside ul {
- padding: 0pt;
+article, section {
+ margin-top: 3em;
+ margin-bottom: 2em;
}
-aside p, aside ul {
- margin: 1em 1ex;
+article header {
+ margin-bottom: 1em;
}
-aside li {
- list-style-type: none;
- margin-bottom: 0.5ex;
+article footer {
+ margin-top: 1em;
}
-article {
- margin-bottom: 3em;
+time, address {
+ color: #999;
+ font-size: small;
}
-.figcaption {
+figcaption {
font-style: italic;
- margin-bottom: 2em;
+ margin-bottom: 2ex;
}
-address {
- font-style: italic;
+img {
+ margin-right: 1ex;
+ margin-bottom: 1ex;
}
diff --git a/template/article.tmpl b/template/article.tmpl
index 7d38dda..e461ce2 100644
--- a/template/article.tmpl
+++ b/template/article.tmpl
@@ -5,15 +5,11 @@
{{define "content"}}
{{with .Doc}}
{{template "doc" .}}
- {{with .Related}}
- <section>
- <h3>Related articles</h3>
+ {{with .Related}}
+ <h5>Related articles</h5>
<ul>
- {{range .}}
- <li><a href="{{.Path}}">{{.Title}}</a></li>
- {{end}}
+ {{range .}}<li><a href="{{.Path}}">{{.Title}}</a></li>{{end}}
</ul>
- </section>
- {{end}}
+ {{end}}
{{end}}
{{end}}
diff --git a/template/doc.tmpl b/template/doc.tmpl
index 26b9624..f82bec4 100644
--- a/template/doc.tmpl
+++ b/template/doc.tmpl
@@ -24,7 +24,9 @@
</ul>
{{end}}
-{{define "newline"}}{{end}}
+{{define "newline"}}
+{{/* newline */}}
+{{end}}
{{define "section"}}
<h4 id="TOC_{{.FormattedNumber}}">{{.Title}}</h4>
@@ -51,21 +53,25 @@
{{end}}
{{define "code"}}
- <code>{{.Text}}</code>
+ <div class="code">{{.Text}}</div>
{{end}}
{{define "image"}}
- <img src="{{.URL}}"{{with .Height}} height="{{.}}"{{end}}{{with .Width}} width="{{.}}"{{end}} alt="image">
+ <img src="https://www.dim13.org/{{.URL}}"{{with .Height}} height="{{.}}"{{end}}{{with .Width}} width="{{.}}"{{end}} alt="image">
{{end}}
{{define "caption"}}
- <div class="figcaption">{{style .Text}}</div>
+ <figcaption>{{style .Text}}</figcaption>
{{end}}
{{define "iframe"}}
+<div class="iframe">
<iframe src="{{.URL}}"{{with .Height}} height="{{.}}"{{end}}{{with .Width}} width="{{.}}"{{end}} frameborder="0" allowfullscreen mozallowfullscreen webkitallowfullscreen></iframe>
+</div>
{{end}}
-{{define "link"}}<p><a href="{{.URL}}" target="_blank">{{style .Label}}</a></p>{{end}}
+{{define "link"}}
+ <p class="link"><a href="{{.URL}}" target="_blank">{{style .Label}}</a></p>
+{{end}}
{{define "html"}}{{.HTML}}{{end}}
diff --git a/template/home.tmpl b/template/home.tmpl
index ca16bb0..2c622b5 100644
--- a/template/home.tmpl
+++ b/template/home.tmpl
@@ -4,9 +4,7 @@
{{define "content"}}
{{range .Data}}
- {{template "doc" .}}
+ {{template "doc" .}}
{{end}}
- <footer>
<p>See the <a href="{{.BasePath}}/index">index</a> for more articles.</p>
- </footer>
{{end}}
diff --git a/template/index.tmpl b/template/index.tmpl
index 843a791..1803dd5 100644
--- a/template/index.tmpl
+++ b/template/index.tmpl
@@ -3,15 +3,22 @@
{{define "title"}}Article index{{end}}
{{define "content"}}
-<section>
+ <section>
<h2>{{template "title"}}</h2>
- <dl>
+ <ul class="list-group">
{{range .Data}}
- <dt><a href="{{.Path}}">{{.Title}}</a></dt>
- <dd>{{template "time" .Time}}
- {{with .Tags}}<div class="tags">{{range .}}{{.}} {{end}}</div>{{end}}
- </dd>
+ <li class="list-group-item">
+ <div class="d-flex justify-content-between">
+ <a href="{{.Path}}">{{.Title}}</a>
+ {{with .Tags}}
+ <span>
+ {{range .}}<span class="badge badge-default">{{.}}</span> {{end}}
+ </span>
+ {{end}}
+ </div>
+ <div>{{template "time" .Time}}</div>
+ </li>
{{end}}
- </dl>
-</section>
+ </ul>
+ </section>
{{end}}
diff --git a/template/root.tmpl b/template/root.tmpl
index 831ac72..817662a 100644
--- a/template/root.tmpl
+++ b/template/root.tmpl
@@ -1,62 +1,65 @@
{{/* This template is combined with other templates to render blog pages. */}}
-{{define "ga"}}
-<script type="text/javascript" async>
- (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),
- m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
- })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
- ga('create', 'UA-22272807-1', 'auto');
- ga('send', 'pageview');
-</script>
-{{end}}
-
-{{define "aside"}}
-<aside>
- <header>
- <h1><a href="{{.BasePath}}/">dim13·blog</a></h1>
- </header>
-
- {{with .Doc}}
- {{with .Older}}
- <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}}
- {{end}}
-
- <h4>Links</h4>
- <ul>
- <li><a href="{{.BasePath}}/index">Blog Index</a></li>
- <li><a href="//github.com/dim13">GitHub</a></li>
- <li><a href="//git.dim13.org">Local Git</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>
- </ul>
-
- <p><img src="avatar/cloupur.png" alt="avatar"></p>
-</aside>
-{{end}}
-
{{define "root" -}}
<!DOCTYPE html>
-<html>
+<html lang="en">
<head>
<title>{{template "title" .}}</title>
- <meta charset="UTF-8">
+
+ <meta charset="utf-8">
<meta name="google-site-verification" content="3cwuN4OwVfNZEGTw5Q9UotI2AJCTzr8F7QB8uhtfAWo">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <link rel="stylesheet" type="text/css" href="/static/fonts.css">
- <link rel="stylesheet" type="text/css" href="/static/style.css">
+ <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
+
+ <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/css/bootstrap.min.css">
+
+ <link rel="stylesheet" type="text/css" href="static/fonts.css">
+ <link rel="stylesheet" type="text/css" href="static/style.css">
+
<link rel="alternate" type="application/atom+xml" title="Atom Feed" href="/feed.atom">
-{{template "ga"}}
</head>
<body>
-{{template "aside" .}}
-{{template "content" .}}
+ <nav class="navbar navbar-expand-sm">
+ <div class="container-fluid">
+ <a class="navbar-brand" href="{{.BasePath}}/">dim13·blog</a>
+ <ul class="navbar-nav">
+ <li class="nav-item"><a class="nav-link" href="{{.BasePath}}/Who-am-I">Who am I</a></li>
+ <li class="nav-item"><a class="nav-link" href="//github.com/dim13">GitHub</a></li>
+ <li class="nav-item"><a class="nav-link" href="//git.dim13.org">Local Git</a></li>
+ <li class="nav-item"><a class="nav-link" href="//ftp.dim13.org">Public FTP</a></li>
+ <li class="nav-item"><a class="nav-link" href="{{.BasePath}}/index">Blog Index</a></li>
+ </ul>
+ </div>
+ </nav>
+
+ <div class="container">
+ {{template "content" .}}
+ </div>
+
+ {{with .Doc}}
+ <nav class="navbar navbar-expand-sm">
+ <div class="container-fluid">
+ <ul class="navbar-nav">
+ {{with .Older}}
+ <li class="nav-item"><a class="nav-link" href="{{.Path}}">&larr; {{.Title}}</a></li>
+ {{end}}
+ </ul>
+ <ul class="navbar-nav">
+ {{with .Newer}}
+ <li class="nav-item"><a class="nav-link" href="{{.Path}}">{{.Title}} &rarr;</a></li>
+ {{end}}
+ </ul>
+ </div>
+ </nav>
+ {{end}}
+
+ <script type="text/javascript" async>
+ (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),
+ m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
+ })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
+ ga('create', 'UA-22272807-1', 'auto');
+ ga('send', 'pageview');
+ </script>
</body>
</html>
{{end}}
@@ -65,14 +68,12 @@
<article>
<header>
<h2><a href="{{.Path}}">{{.Title}}</a></h2>
- <p>{{template "time" .Time}}</p>
+ {{template "time" .Time}}
</header>
{{.HTML}}
- {{with .Authors}}
<footer>
- <address>By {{authors .}}</address>
+ {{with .Authors}}<address>By {{authors .}}</address>{{end}}
</footer>
- {{end}}
</article>
{{end}}
diff --git a/vendor/golang.org/x/tools/README.md b/vendor/golang.org/x/tools/README.md
new file mode 100644
index 0000000..20be9e1
--- /dev/null
+++ b/vendor/golang.org/x/tools/README.md
@@ -0,0 +1,27 @@
+# Go Tools
+
+This subrepository holds the source for various packages and tools that support
+the Go programming language.
+
+Some of the tools, `godoc` and `vet` for example, are included in binary Go
+distributions.
+
+Others, including the Go `guru` and the test coverage tool, can be fetched with
+`go get`.
+
+Packages include a type-checker for Go and an implementation of the
+Static Single Assignment form (SSA) representation for Go programs.
+
+## Download/Install
+
+The easiest way to install is to run `go get -u golang.org/x/tools/...`. You can
+also manually git clone the repository to `$GOPATH/src/golang.org/x/tools`.
+
+## Report Issues / Send Patches
+
+This repository uses Gerrit for code changes. To learn how to submit changes to
+this repository, see https://golang.org/doc/contribute.html.
+
+The main issue tracker for the tools repository is located at
+https://github.com/golang/go/issues. Prefix your issue with "x/tools/(your
+subdir):" in the subject line, so it is easy to find.