render notes fully
This commit is contained in:
parent
0db1c7a9ec
commit
c67535c1d9
|
@ -1,10 +1,14 @@
|
|||
<div class="h-feed">
|
||||
{{range .}}
|
||||
<div class="h-entry">
|
||||
{{range .}}
|
||||
<div class="h-entry">
|
||||
<hgroup>
|
||||
{{ if eq .Meta.Type "note"}}
|
||||
<p>{{.RenderedContent}}</p>
|
||||
{{ else }}
|
||||
<h3><a class="u-url" href="{{.UrlPath}}">
|
||||
{{ if .Title }}{{.Title}}{{ else }}Note: {{.Id}}{{ end }}
|
||||
{{ if .Title }}{{.Title}}{{ else }}{{.Id}}{{ end }}
|
||||
</a></h3>
|
||||
{{ end }}
|
||||
<small>
|
||||
Published:
|
||||
<time class="dt-published" datetime="{{.Meta.Date}}">
|
||||
|
@ -12,7 +16,7 @@
|
|||
</time>
|
||||
</small>
|
||||
</hgroup>
|
||||
</div>
|
||||
<hr>
|
||||
{{end}}
|
||||
</div>
|
||||
<hr>
|
||||
{{end}}
|
||||
</div>
|
|
@ -81,13 +81,14 @@ func TestCanRenderPostList(t *testing.T) {
|
|||
user := getTestUser()
|
||||
user.CreateNewPost("testpost1", false)
|
||||
user.CreateNewPost("testpost2", false)
|
||||
result, _ := owl.RenderPostList(user, &owl.PostList{
|
||||
result, err := owl.RenderPostList(user, &owl.PostList{
|
||||
Id: "testlist",
|
||||
Title: "Test List",
|
||||
Include: []string{
|
||||
"article",
|
||||
},
|
||||
})
|
||||
assertions.AssertNoError(t, err, "Error rendering post list")
|
||||
assertions.AssertContains(t, result, "testpost1")
|
||||
assertions.AssertContains(t, result, "testpost2")
|
||||
}
|
||||
|
@ -138,7 +139,13 @@ func TestCanRenderIndexPageNoTitle(t *testing.T) {
|
|||
post, _ := user.CreateNewPostFull(owl.PostMeta{}, "hi")
|
||||
result, _ := owl.RenderIndexPage(user)
|
||||
assertions.AssertContains(t, result, post.Id())
|
||||
assertions.AssertContains(t, result, "Note: ")
|
||||
}
|
||||
|
||||
func TestRenderNoteAsFullContent(t *testing.T) {
|
||||
user := getTestUser()
|
||||
post, _ := user.CreateNewPostFull(owl.PostMeta{Type: "note"}, "hi")
|
||||
result, _ := owl.RenderPost(post)
|
||||
assertions.AssertContains(t, result, "hi")
|
||||
}
|
||||
|
||||
func TestIndexPageContainsHFeedContainer(t *testing.T) {
|
||||
|
|
Loading…
Reference in New Issue