summaryrefslogtreecommitdiffstats
path: root/templates/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'templates/index.html')
-rw-r--r--templates/index.html44
1 files changed, 44 insertions, 0 deletions
diff --git a/templates/index.html b/templates/index.html
new file mode 100644
index 0000000..ae46faf
--- /dev/null
+++ b/templates/index.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<html>
+
+<head>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <title>nebbet.no</title>
+ <link rel="stylesheet" href="/assets/styles/main.css">
+</head>
+
+<body>
+ <main>
+ <h1>Posts</h1>
+ <form class="search" method="GET" action="/">
+ <input type="search" name="q" 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">
+ {{range .Tags}}<a href="/?tag={{.}}" class="tag">{{.}}</a>{{end}}
+ </div>
+ {{end}}
+ </li>
+ {{end}}
+ </ul>
+ {{else}}
+ <p class="empty">Dessverre.</p>
+ {{end}}
+ </main>
+</body>
+
+</html> \ No newline at end of file