13 lines
301 B
Go
Raw Normal View History

2018-04-13 10:20:13 +00:00
package utils
const maxDescriptionLength = 170
// CutLongDescription cuts a long description for use in OpenGraph tags.
func CutLongDescription(description string) string {
if len(description) > maxDescriptionLength {
return description[:maxDescriptionLength-3] + "..."
}
return description
}