Added lyrics display
This commit is contained in:
12
utils/CutLongDescription.go
Normal file
12
utils/CutLongDescription.go
Normal file
@ -0,0 +1,12 @@
|
||||
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
|
||||
}
|
Reference in New Issue
Block a user