small refactoring
This commit is contained in:
parent
3c6df116fa
commit
defe031bc3
12
renderer.go
12
renderer.go
|
@ -75,12 +75,10 @@ func RenderPost(post Post) (string, error) {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
|
||||||
data := PageContent{
|
return renderIntoBaseTemplate(*post.user, PageContent{
|
||||||
Title: post.Title(),
|
Title: post.Title(),
|
||||||
Content: template.HTML(postHtml),
|
Content: template.HTML(postHtml),
|
||||||
}
|
})
|
||||||
|
|
||||||
return renderIntoBaseTemplate(*post.user, data)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func RenderIndexPage(user User) (string, error) {
|
func RenderIndexPage(user User) (string, error) {
|
||||||
|
@ -91,12 +89,10 @@ func RenderIndexPage(user User) (string, error) {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
|
||||||
data := PageContent{
|
return renderIntoBaseTemplate(user, PageContent{
|
||||||
Title: "Index",
|
Title: "Index",
|
||||||
Content: template.HTML(postHtml),
|
Content: template.HTML(postHtml),
|
||||||
}
|
})
|
||||||
|
|
||||||
return renderIntoBaseTemplate(user, data)
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue