refactor: rely heavier on the templating engine

style: fix comments spacing on mobile
This commit is contained in:
httpjamesm 2022-12-29 13:06:14 -05:00
parent c0df07abad
commit 3b79efc83c
7 changed files with 151 additions and 46 deletions

17
src/types/answer.go Normal file
View file

@ -0,0 +1,17 @@
package types
import "html/template"
type FilteredAnswer struct {
Upvotes string
IsAccepted bool
AuthorName string
AuthorURL string
Timestamp string
Body template.HTML
Comments []FilteredComment
}

8
src/types/comment.go Normal file
View file

@ -0,0 +1,8 @@
package types
type FilteredComment struct {
Text string
Timestamp string
AuthorName string
AuthorURL string
}

12
src/types/question.go Normal file
View file

@ -0,0 +1,12 @@
package types
import "html/template"
type FilteredQuestion struct {
Title string
Body template.HTML
Timestamp string
AuthorName string
AuthorURL string
ShortenedBody string
}