diff --git a/src/routes/question.go b/src/routes/question.go index 07efcc9..ce101cd 100644 --- a/src/routes/question.go +++ b/src/routes/question.go @@ -148,13 +148,14 @@ func ViewQuestion(c *gin.Context) { } c.HTML(200, "question.html", gin.H{ - "title": questionText, - "body": template.HTML(questionBodyParentHTML), - "timestamp": questionTimestamp, - "author": questionAuthor, - "authorURL": questionAuthorURL, - "answers": answers, - "imagePolicy": imagePolicy, + "title": questionText, + "body": template.HTML(questionBodyParentHTML), + "timestamp": questionTimestamp, + "author": questionAuthor, + "authorURL": questionAuthorURL, + "answers": answers, + "imagePolicy": imagePolicy, + "shortenedBody": questionBodyParent.Text()[0:50], }) } diff --git a/templates/home.html b/templates/home.html index 385f3fc..a51d76b 100644 --- a/templates/home.html +++ b/templates/home.html @@ -10,6 +10,9 @@ content="default-src 'none'; style-src 'self'; script-src 'none'; img-src 'self';" /> + + +
diff --git a/templates/question.html b/templates/question.html index afad65c..d7e683d 100644 --- a/templates/question.html +++ b/templates/question.html @@ -10,6 +10,9 @@ content="default-src 'none'; style-src 'self'; script-src 'none'; img-src {{ .imagePolicy }};" /> + + +