WIP micropub #28

Merged
h4kor merged 7 commits from micropub into main 2022-11-19 15:35:31 +00:00
2 changed files with 11 additions and 1 deletions
Showing only changes of commit 396b84c9bb - Show all commits

View File

@ -2,7 +2,9 @@
{{range .}}
<div class="h-entry">
<hgroup>
<h3><a class="u-url" href="{{.UrlPath}}">{{.Title}}</a></h3>
<h3><a class="u-url" href="{{.UrlPath}}">
{{ if .Title }}{{.Title}}{{ else }}Note: {{.Id}}{{ end }}
</a></h3>
<small>
Published:
<time class="dt-published" datetime="{{.Meta.Date}}">

View File

@ -86,6 +86,14 @@ func TestCanRenderIndexPage(t *testing.T) {
assertions.AssertContains(t, result, "testpost2")
}
func TestCanRenderIndexPageNoTitle(t *testing.T) {
user := getTestUser()
post, _ := user.CreateNewPostFull(owl.PostMeta{}, "hi")
result, _ := owl.RenderIndexPage(user)
assertions.AssertContains(t, result, post.Id())
assertions.AssertContains(t, result, "Note: ")
}
func TestIndexPageContainsHFeedContainer(t *testing.T) {
user := getTestUser()
user.CreateNewPost("testpost1", false)