diff options
-rw-r--r-- | templates/post_actions.html | 5 | ||||
-rw-r--r-- | templates/post_teaser.html | 6 | ||||
-rw-r--r-- | templates/show_post.html | 10 |
3 files changed, 11 insertions, 10 deletions
diff --git a/templates/post_actions.html b/templates/post_actions.html new file mode 100644 index 0000000..acc47d5 --- /dev/null +++ b/templates/post_actions.html @@ -0,0 +1,5 @@ +<div class="post-actions"> + <a href="/posts/{{ .id }}/edit">Edit</a> | + Publish | + <a href="/posts/{{ .id }}/delete">Delete</a> +</div> diff --git a/templates/post_teaser.html b/templates/post_teaser.html index 482cf73..4d412ba 100644 --- a/templates/post_teaser.html +++ b/templates/post_teaser.html @@ -1,11 +1,7 @@ <article class="post-teaser"> <header> <h1><a href="/posts/{{ .id }}">{{ .title }}</a></h1> - <div class="post-actions"> - <a href="/posts/{{ .id }}/edit">Edit</a> | - Publish | - <a href="/posts/{{ .id }}/delete">Delete</a> - </div> + {{> post_actions.html }} </header> <section class="teaser"> {{ .body }} diff --git a/templates/show_post.html b/templates/show_post.html index 5a7d806..31c2ca3 100644 --- a/templates/show_post.html +++ b/templates/show_post.html @@ -5,15 +5,15 @@ </head> <body> <article class="post-teaser"> + {{# post. }} <header> - <h1>{{ post.title }}</h1> - <div class="post-actions"> - Edit | Publish | Delete - </div> + <h1>{{ .title }}</h1> + {{> post_actions.html }} </header> <section class="teaser"> - {{ post.body }} + {{ .body }} </section> + {{/ post }} </article> </body> </html> |