aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2017-11-16 17:20:46 +0100
committerHarald Eilertsen <haraldei@anduin.net>2017-11-16 17:20:46 +0100
commit44c10f9710632a72427120ccdb9f16ad146574b4 (patch)
tree66de95370195b352c5e7f993a3e3a65061845fc9
parent114b777b806f793ebfe21895830bae99f524c9d5 (diff)
downloadrocket-blog-44c10f9710632a72427120ccdb9f16ad146574b4.tar.gz
rocket-blog-44c10f9710632a72427120ccdb9f16ad146574b4.tar.bz2
rocket-blog-44c10f9710632a72427120ccdb9f16ad146574b4.zip
Render post teasers using partial.
-rw-r--r--templates/index.html4
-rw-r--r--templates/post_teaser.html8
2 files changed, 9 insertions, 3 deletions
diff --git a/templates/index.html b/templates/index.html
index a4279bd..2a3a95b 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -4,8 +4,6 @@
<title>{{ title }}</title>
</head>
<body>
- <ul>
- {{# posts }}<li>{{ .title }}</li>{{/ posts }}
- </ul>
+ {{# posts }}{{> post_teaser.html }}{{/ posts }}
</body>
</html>
diff --git a/templates/post_teaser.html b/templates/post_teaser.html
new file mode 100644
index 0000000..5198400
--- /dev/null
+++ b/templates/post_teaser.html
@@ -0,0 +1,8 @@
+<article class="post-teaser">
+ <header>
+ <h1>{{ .title }}</h1>
+ </header>
+ <section class="teaser">
+ {{ .body }}
+ </section>
+</article> \ No newline at end of file