mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 02:22:26 -05:00
[feature] opengraph meta tags (#806)
* f0x gitignore additions * better meta title and descriptions * user avatar icon for thread and profile meta tags * use proper tag for image * whitespace * add noescapeAttr template function * use ogMeta struct for opengraph * maxOGDescriptionLength = 300 Co-authored-by: tsmethurst <tobi.smethurst@protonmail.com>
This commit is contained in:
parent
a872ddebe6
commit
d09ddb4769
7 changed files with 179 additions and 7 deletions
|
|
@ -70,6 +70,11 @@ func noescape(str string) template.HTML {
|
|||
return template.HTML(str)
|
||||
}
|
||||
|
||||
func noescapeAttr(str string) template.HTMLAttr {
|
||||
/* #nosec G203 */
|
||||
return template.HTMLAttr(str)
|
||||
}
|
||||
|
||||
func timestamp(stamp string) string {
|
||||
t, _ := time.Parse(time.RFC3339, stamp)
|
||||
return t.Format("January 2, 2006, 15:04:05")
|
||||
|
|
@ -151,6 +156,7 @@ func LoadTemplateFunctions(engine *gin.Engine) {
|
|||
engine.SetFuncMap(template.FuncMap{
|
||||
"escape": escape,
|
||||
"noescape": noescape,
|
||||
"noescapeAttr": noescapeAttr,
|
||||
"oddOrEven": oddOrEven,
|
||||
"visibilityIcon": visibilityIcon,
|
||||
"timestamp": timestamp,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue