summaryrefslogtreecommitdiff
path: root/template
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2019-01-20 12:35:37 +0100
committerDimitri Sokolyuk <demon@dim13.org>2019-01-20 12:35:37 +0100
commitf12d854fcf5e46fe526a92a316b2c6ec118fcea3 (patch)
tree284d40c6eb60a5163fee6fc4bb2007937a539a1b /template
parent312ecbfa56c625903f1b1d56408326145b2fce2d (diff)
Replace fcgi with plain http server
Diffstat (limited to 'template')
-rw-r--r--template/article.tmpl15
-rw-r--r--template/doc.tmpl77
-rw-r--r--template/home.tmpl10
-rw-r--r--template/index.tmpl24
-rw-r--r--template/root.tmpl80
5 files changed, 0 insertions, 206 deletions
diff --git a/template/article.tmpl b/template/article.tmpl
deleted file mode 100644
index e461ce2..0000000
--- a/template/article.tmpl
+++ /dev/null
@@ -1,15 +0,0 @@
-{{/* 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}}
- <h5>Related articles</h5>
- <ul>
- {{range .}}<li><a href="{{.Path}}">{{.Title}}</a></li>{{end}}
- </ul>
- {{end}}
- {{end}}
-{{end}}
diff --git a/template/doc.tmpl b/template/doc.tmpl
deleted file mode 100644
index b50790d..0000000
--- a/template/doc.tmpl
+++ /dev/null
@@ -1,77 +0,0 @@
-{{/* This doc template is given to the present tool to format articles. */}}
-
-{{define "root"}}
- {{with .Subtitle}}<h3>{{.}}</h3>{{end}}
- {{if .Doc | sectioned}}
- {{range .Sections}}
- {{elem $.Template .}}
- {{end}}
- {{else}}
- {{with index .Sections 0}}
- {{range .Elem}}
- {{elem $.Template .}}
- {{end}}
- {{end}}
- {{end}}
-{{end}}
-
-{{define "TOC"}}
- <ul>
- {{range .}}
- <li><a href="#TOC_{{.FormattedNumber}}">{{.Title}}</a></li>
- {{with .Sections}}{{template "TOC" .}}{{end}}
- {{end}}
- </ul>
-{{end}}
-
-{{define "newline"}}
-{{/* newline */}}
-{{end}}
-
-{{define "section"}}
- <h4 id="TOC_{{.FormattedNumber}}">{{.Title}}</h4>
- {{range .Elem}}{{elem $.Template .}}{{end}}
-{{end}}
-
-{{define "list"}}
- <ul>
- {{range .Bullet}}
- <li>{{style .}}</li>
- {{end}}
- </ul>
-{{end}}
-
-{{define "text"}}
- {{if .Pre}}
- <pre>{{range .Lines}}{{.}}{{end}}</pre>
- {{else}}
- <p>
- {{range $i, $l := .Lines}}{{if $i}}{{template "newline"}}
- {{end}}{{style $l}}{{end}}
- </p>
- {{end}}
-{{end}}
-
-{{define "code"}}
- <div class="code">{{.Text}}</div>
-{{end}}
-
-{{define "image"}}
- <img src="{{.URL}}"{{with .Height}} height="{{.}}"{{end}}{{with .Width}} width="{{.}}"{{end}} alt="image">
-{{end}}
-
-{{define "caption"}}
- <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 class="link"><a href="{{.URL}}" target="_blank" rel="noopener">{{style .Label}}</a></p>
-{{end}}
-
-{{define "html"}}{{.HTML}}{{end}}
diff --git a/template/home.tmpl b/template/home.tmpl
deleted file mode 100644
index 2c622b5..0000000
--- a/template/home.tmpl
+++ /dev/null
@@ -1,10 +0,0 @@
-{{/* This file is combined with the root.tmpl to display the blog home page. */}}
-
-{{define "title"}}dim13{{end}}
-
-{{define "content"}}
- {{range .Data}}
- {{template "doc" .}}
- {{end}}
- <p>See the <a href="{{.BasePath}}/index">index</a> for more articles.</p>
-{{end}}
diff --git a/template/index.tmpl b/template/index.tmpl
deleted file mode 100644
index 1803dd5..0000000
--- a/template/index.tmpl
+++ /dev/null
@@ -1,24 +0,0 @@
-{{/* This file is combined with the root.tmpl to display the blog index. */}}
-
-{{define "title"}}Article index{{end}}
-
-{{define "content"}}
- <section>
- <h2>{{template "title"}}</h2>
- <ul class="list-group">
- {{range .Data}}
- <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}}
- </ul>
- </section>
-{{end}}
diff --git a/template/root.tmpl b/template/root.tmpl
deleted file mode 100644
index 164cf31..0000000
--- a/template/root.tmpl
+++ /dev/null
@@ -1,80 +0,0 @@
-{{/* This template is combined with other templates to render blog pages. */}}
-
-{{define "root" -}}
-<!DOCTYPE html>
-<html lang="en">
-<head>
- <title>{{template "title" .}}</title>
-
- <meta charset="utf-8">
- <meta name="google-site-verification" content="3cwuN4OwVfNZEGTw5Q9UotI2AJCTzr8F7QB8uhtfAWo">
- <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/css/bootstrap.min.css">
- <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Abel|Raleway|Space+Mono">
- <link rel="stylesheet" href="/static/style.css">
- <link rel="alternate" type="application/atom+xml" title="Atom Feed" href="/feed.atom">
-
- <!-- Global site tag (gtag.js) - Google Analytics -->
- <script async src="https://www.googletagmanager.com/gtag/js?id=UA-22272807-1"></script>
- <script>
- window.dataLayer = window.dataLayer || [];
- function gtag(){dataLayer.push(arguments);}
- gtag('js', new Date());
- gtag('config', 'UA-22272807-1');
- </script>
-</head>
-<body>
- <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}}
-</body>
-</html>
-{{end}}
-
-{{define "doc"}}
- <article>
- <header>
- <h2><a href="{{.Path}}">{{.Title}}</a></h2>
- {{template "time" .Time}}
- </header>
- {{.HTML}}
- <footer>
- {{with .Authors}}<address>By {{authors .}}</address>{{end}}
- </footer>
- </article>
-{{end}}
-
-{{define "time" -}}
-<time datetime="{{.Format "2006-01-02T15:04:05Z07:00"}}">{{.Format "2 January 2006"}}</time>
-{{- end}}