summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
Diffstat (limited to 'templates')
-rw-r--r--templates/archive-day.html13
-rw-r--r--templates/archive-month.html16
-rw-r--r--templates/archive-year.html15
-rw-r--r--templates/archive.html12
-rw-r--r--templates/article.html7
-rw-r--r--templates/blog.html12
-rw-r--r--templates/content.html3
-rw-r--r--templates/root.html66
-rw-r--r--templates/search.html21
-rw-r--r--templates/start.html8
-rw-r--r--templates/tag.html13
-rw-r--r--templates/tags.html6
12 files changed, 192 insertions, 0 deletions
diff --git a/templates/archive-day.html b/templates/archive-day.html
new file mode 100644
index 0000000..16bd09a
--- /dev/null
+++ b/templates/archive-day.html
@@ -0,0 +1,13 @@
+{{define "main"}}
+{{- $year := .Year -}}
+{{- $month := .Month -}}
+{{- $day := .Day -}}
+<h1>{{nth .Day}} <a href="{{archive_link .Year .Month}}">{{.MonthText}}</a> <a href="{{archive_link .Year}}">{{.Year}}</a></h1>
+{{with .Articles}}
+{{template "article_list" .}}
+{{else}}
+<p>Nothing for this day.</p>
+{{end}}
+
+<p><a href="{{archive_link .Year .Month (add .Day -1)}}" rel="prev">&lt; Previous</a> | <a href="{{archive_link .Year .Month (add .Day 1)}}" rel="next">Next &gt;</a></p>
+{{end}}
diff --git a/templates/archive-month.html b/templates/archive-month.html
new file mode 100644
index 0000000..1d872a9
--- /dev/null
+++ b/templates/archive-month.html
@@ -0,0 +1,16 @@
+{{define "main"}}
+{{- $year := .Year -}}
+{{- $month := .Month -}}
+<h1>{{month_text .Month}} <a href="{{archive_link .Year}}">{{.Year}}</a></h1>
+{{with .Days}}
+<ul>
+ {{range .}}
+ <li><a href="{{archive_link $year $month .Num}}">{{day_text $year $month .Num}} [{{.Count}}]</a>
+ {{end}}
+</ul>
+{{else}}
+<p>Nothing for this month.</p>
+{{end}}
+
+<p><a href="{{archive_link .Year (add .Month -1)}}" rel="prev">&lt; Previous</a> | <a href="{{archive_link .Year (add .Month 1)}}" rel="next">Next &gt;</a></p>
+{{end}}
diff --git a/templates/archive-year.html b/templates/archive-year.html
new file mode 100644
index 0000000..c4aa7ee
--- /dev/null
+++ b/templates/archive-year.html
@@ -0,0 +1,15 @@
+{{define "main"}}
+{{- $year := .Year -}}
+<h1>{{.Year}}</h1>
+{{with .Months}}
+<ul>
+ {{range .}}
+ <li><a href="{{archive_link $year .Num}}">{{month_text .Num}} {{$year}} [{{.Count}}]</a>
+ {{end}}
+</ul>
+{{else}}
+<p>Nothing for this year.</p>
+{{end}}
+
+<p><a href="{{archive_link (add .Year -1)}}" rel="prev">&lt; Previous</a> | <a href="{{archive_link (add .Year 1)}}" rel="next">Next &gt;</a></p>
+{{end}}
diff --git a/templates/archive.html b/templates/archive.html
new file mode 100644
index 0000000..42eba08
--- /dev/null
+++ b/templates/archive.html
@@ -0,0 +1,12 @@
+{{define "main"}}
+<h1>Archive</h1>
+{{with .Years}}
+<ul>
+ {{range .}}
+ <li><a href="{{archive_link .Num}}">{{.Num}} [{{.Count}}]</a>
+ {{end}}
+</ul>
+{{else}}
+<p>Nothing yet :(</p>
+{{end}}
+{{end}}
diff --git a/templates/article.html b/templates/article.html
new file mode 100644
index 0000000..a208c75
--- /dev/null
+++ b/templates/article.html
@@ -0,0 +1,7 @@
+{{define "main"}}
+<article>
+ <h1>{{.Title}}</h1>
+ {{template "article_meta" .}}
+ <div class="content">{{.Content}}</div>
+</article>
+{{end}}
diff --git a/templates/blog.html b/templates/blog.html
new file mode 100644
index 0000000..117f5ab
--- /dev/null
+++ b/templates/blog.html
@@ -0,0 +1,12 @@
+{{define "main"}}
+{{with .Articles}}
+ {{template "article_list" .}}
+{{else}}
+ <p>Nothing found</p>
+{{end}}
+
+{{if gt .Pages 1}}
+ <p>{{pagination .Pages .Page "/blog"}}</p>
+{{end}}
+
+{{end}}
diff --git a/templates/content.html b/templates/content.html
new file mode 100644
index 0000000..ba58e3c
--- /dev/null
+++ b/templates/content.html
@@ -0,0 +1,3 @@
+{{define "main"}}
+<article>{{.}}</article>
+{{end}}
diff --git a/templates/root.html b/templates/root.html
new file mode 100644
index 0000000..abc66bf
--- /dev/null
+++ b/templates/root.html
@@ -0,0 +1,66 @@
+{{- define "article_meta"}}
+ <dl class="meta">
+ <div>
+ <dt>Published</dt>
+ <dd><time datetime="2006-01-02T15:04:05-0700">{{.Published.Format "Mon, Jan 2 2006, 15:04"}}</time></dd>
+ </div>
+ {{with .Tags}}
+ <div>
+ <dt>Tags</dt>
+ <dd><ul class="article-tags">{{range .}}
+ <li><a href="/blog/tags/{{.}}">{{.}}</a></li>
+ {{end}}</ul></dd>
+ </div>
+ {{end}}
+ </dl>
+{{end -}}
+{{- define "article_list"}}
+ {{range .}}
+ {{- $year := .Published.Format "2006" -}}
+ {{- $month := .Published.Format "01" -}}
+ {{- $day := .Published.Format "02" -}}
+ <article>
+ <h2><a href="/blog/{{$year}}/{{$month}}/{{$day}}/{{.Slug}}">{{.Title}}</a></h2>
+ {{template "article_meta" .}}
+ <div class="content">{{.Content}}</div>
+ {{if .ReadMore -}}
+ <p class="readmore-outer"><a href="/blog/{{$year}}/{{$month}}/{{$day}}/{{.Slug}}">Read more ...</a></p>
+ {{- end}}
+ </article>
+ {{end}}
+{{end -}}
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ <title>{{with .Title}}{{.}} - {{end}}laria.me</title>
+ <link rel="stylesheet" type="text/css" href="/static/style.css">
+ <link rel="stylesheet" type="text/css" href="/static/syntax.css">
+ <link rel="alternate" type="application/atom+xml" href="/blog/feed.xml" title="Atom-Feed of the blog">
+ <link rel="author" href="/about-me" />
+ <meta name="author" content="Laria Carolin Chabowski" />
+ <meta name="description" content="Laria's website. They mainly write about adventures in programming but will also occasionally write about other things that interest them." />
+ <meta name="keywords" content="programming,blog,golang,php,music,links,gsrm,lgbt,lgbtq,genderqueer,trans,technology,web,opensource" />
+</head>
+<body>
+ <a href="#maincontent" class="skip-to-main-content">Skip to main content</a>
+ <header>
+ <a href="/" class="logolink">laria.me</a>
+ <nav>
+ {{ range .Menu }}
+ <!-- TODO: Label menus for screenreaders -->
+ <ul class="menu-level">{{ range . }}
+ <li {{ if .Active }}class="cur"{{ end }}><a href="{{ .Url }}">{{ .Title }}</a></li>
+ {{ end }}</ul>
+ {{ end }}
+ </nav>
+ </header>
+ <main id="maincontent">{{ template "main" .Main }}</main>
+ <footer>
+ <p>Contents of this page is copyrighted under the [WTFPL](http://www.wtfpl.net), unless noted otherwise. The content of the linked pages is © of their respective owners. You can contact me via email: <code>laria (minus) blog (at) laria (dot) me</code>.</p>
+ <p>If you really need more info, use the <a href="/impressum">Impressum</a>.</p>
+ </footer>
+</body>
+</html>
diff --git a/templates/search.html b/templates/search.html
new file mode 100644
index 0000000..9a6dbf7
--- /dev/null
+++ b/templates/search.html
@@ -0,0 +1,21 @@
+{{define "main"}}
+<form action="/blog/search" method="get">
+ <label>Search terms: <input type="text" name="q" value="{{.Q}}"></label>
+ <button type="submit">Go</button>
+ <!-- TODO: Form looks ugly, especially in dark mode -->
+</form>
+
+{{if .Q}}
+{{if gt .Total 0}}
+ <h1>Results ({{.Total}} total)</h1>
+ {{template "article_list" .Results}}
+
+ {{if gt .Pages 1}}
+ <p>{{pagination .Pages .Page "/blog/search" "q" .Q}}</p>
+ {{end}}
+{{else}}
+ <p>Nothing found</p>
+{{end}}
+{{end}}
+
+{{end}}
diff --git a/templates/start.html b/templates/start.html
new file mode 100644
index 0000000..cd97639
--- /dev/null
+++ b/templates/start.html
@@ -0,0 +1,8 @@
+{{block "main" .}}
+<article class="main-content">{{.Content}}</article>
+{{with .Blog}}
+ <p>Here are my latest blog entries:</p>
+ {{template "article_list" .}}
+ <p><a href="/blog">Read more blog entries</a>.</p>
+{{end}}
+{{end}}
diff --git a/templates/tag.html b/templates/tag.html
new file mode 100644
index 0000000..02fe5b3
--- /dev/null
+++ b/templates/tag.html
@@ -0,0 +1,13 @@
+{{define "main"}}
+<h1>Tag: {{.Tag}}</h1>
+{{with .Articles}}
+ {{template "article_list" .}}
+{{else}}
+ <p>Nothing found</p>
+{{end}}
+
+{{if gt .Pages 1}}
+ <p>{{pagination .Pages .Page (concat "/blog/tags/" .Tag)}}</p>
+{{end}}
+
+{{end}}
diff --git a/templates/tags.html b/templates/tags.html
new file mode 100644
index 0000000..7df7351
--- /dev/null
+++ b/templates/tags.html
@@ -0,0 +1,6 @@
+{{define "main"}}
+<h1>Tags</h1>
+{{with .Tags}}<ul class="tagcloud">{{range .}}
+ <li class="tc-{{.SizeClass}}"><a href="/blog/tags/{{.Tag}}">{{.Tag}}</a></li>
+{{end}}</ul>{{end}}
+{{end}}