about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAlan Pearce2014-07-12 11:29:03 +0100
committerAlan Pearce2014-07-12 11:29:03 +0100
commit86e04c8bb73205ecf7bdb769a1f428c0cfdaeee2 (patch)
tree271735db528394bb44b13d43a991350055144d77
parentb06839295833e935dfd9719be222fc8bd87b7487 (diff)
downloadhyde-86e04c8bb73205ecf7bdb769a1f428c0cfdaeee2.tar.lz
hyde-86e04c8bb73205ecf7bdb769a1f428c0cfdaeee2.tar.zst
hyde-86e04c8bb73205ecf7bdb769a1f428c0cfdaeee2.zip
Make homepage show categories and recent posts
-rw-r--r--layouts/index.html34
1 files changed, 21 insertions, 13 deletions
diff --git a/layouts/index.html b/layouts/index.html
index 2ea98bf..135644b 100644
--- a/layouts/index.html
+++ b/layouts/index.html
@@ -1,19 +1,27 @@
 {{ template "theme/partials/head.html" . }}
 	<body class="theme-base-0b layout-reverse">
 		<main class="content container" role="main">
-			<div class="posts">
-				{{ range .Data.Pages }}
-				<article class="post">
-					<h1 class="post-title">
-						<a href="{{ .Permalink }}">
-							{{ .Title }}
-						</a>
-					</h1>
-					<time class="post-date">{{ .Date.Format "Monday, 2 January 2006" }}</time>
-					{{ .Content }}
-				</article>
-				{{ end }}
-			</div>
+			<section class="categories">
+				<h2>Categories</h2>
+				<ul>
+					{{ range $key, $value := .Site.Indexes.categories }}
+					<li>
+						<a href="/categories/{{ $key | urlize }}">{{ $key | title }}</a>
+					</li>
+					{{ end }}
+				</ul>
+			</section>
+			<section class="recent">
+				<h2>Recent Posts</h2>
+				<ul>
+					{{ range .Data.Pages }}
+					<li>
+						<a class="post-title" href="{{ .Permalink }}">{{ .Title }}</a>
+						<time class="post-date">{{ .Date.Format "Monday, 2 January 2006" }}</time>
+					</li>
+					{{ end }}
+				</ul>
+			</section>
 		</main>
 {{ template "theme/partials/sidebar.html" . }}
 	</body>