feat: OG metadata and shortened desc

This commit is contained in:
httpjamesm 2022-12-28 00:58:41 -05:00
parent 607ed44ee0
commit ba4a9155a7
3 changed files with 14 additions and 7 deletions

View file

@ -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],
})
}