summaryrefslogtreecommitdiffstats
path: root/templates/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'templates/index.html')
-rw-r--r--templates/index.html47
1 files changed, 47 insertions, 0 deletions
diff --git a/templates/index.html b/templates/index.html
new file mode 100644
index 0000000..00cae5c
--- /dev/null
+++ b/templates/index.html
@@ -0,0 +1,47 @@
+{{define "index.html"}}
+<!DOCTYPE html>
+<html>
+
+<head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <title>{{.SiteTitle}}</title>
+ <link rel="icon" href="/assets/static/image.png" type="image/png">
+ <link rel="stylesheet" href="/assets/styles/main.css">
+</head>
+
+<body>
+ <main>
+ <img src="/assets/static/image.png" alt="nebb" id="logo">
+ <form class="search" method="GET" action="/">
+ <input type="search" name="q" required value="{{.Query}}" placeholder="...">
+ <button type="submit">Søk</button>
+ {{if .Query}}<a href="/">Tøm</a>{{end}}
+ </form>
+
+ {{if .ActiveTag}}
+ <p class="filter-info">Emne: <strong>{{.ActiveTag}}</strong> <a href="/">tøm</a></p>
+ {{end}}
+
+ {{if .Posts}}
+ <ul class="post-list">
+ {{range .Posts}}
+ <li>
+ <a href="/{{.Slug}}">{{.Title}}</a>
+ <time>{{.Date}}</time>
+ {{if .Tags}}
+ <div class="tags">
+ emne: {{range .Tags}}<a href="/?tag={{.}}" class="tag">{{.}}</a> {{end}}
+ </div>
+ {{end}}
+ </li>
+ {{end}}
+ </ul>
+ {{else}}
+ <p class="empty">Dessverre.</p>
+ {{end}}
+ </main>
+</body>
+
+</html>
+{{end}} \ No newline at end of file