diff --git a/main.go b/main.go index a64521c..a27bbd6 100644 --- a/main.go +++ b/main.go @@ -96,12 +96,22 @@ func main() { } }) + answers := []template.HTML{} + doc.Find("div.answer").Each(func(i int, s *goquery.Selection) { + postLayout := s.Find("div.post-layout") + answerCell := postLayout.Find("div.answercell") + answerBody := answerCell.Find("div.s-prose") + answerBodyHTML, _ := answerBody.Html() + answers = append(answers, template.HTML(answerBodyHTML)) + }) + c.HTML(200, "question.html", gin.H{ "title": questionText, "body": template.HTML(questionBodyParentHTML), "timestamp": questionTimestamp, "author": questionAuthor, "authorURL": questionAuthorURL, + "answers": answers, }) }) diff --git a/public/question.css b/public/question.css index 168bd0b..8cf82b2 100644 --- a/public/question.css +++ b/public/question.css @@ -30,6 +30,11 @@ body { box-sizing: border-box; } +.parent { + max-width: 90%; + width: fit-content; +} + code { background-color: var(--code-bg); padding: .15rem; @@ -54,4 +59,12 @@ pre { a { color: #92adff; +} + +.answer-divider { + margin-top: 3rem; + margin-bottom: 3rem; + border: 0; + height: 1px; + background-color: #42464e; } \ No newline at end of file diff --git a/templates/question.html b/templates/question.html index 64bbba0..876c957 100644 --- a/templates/question.html +++ b/templates/question.html @@ -18,6 +18,10 @@