mirror of
https://github.com/Theodor-Springmann-Stiftung/lenz-web.git
synced 2025-10-29 17:25:32 +00:00
Init
This commit is contained in:
17
helpers/functions/string.go
Normal file
17
helpers/functions/string.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package functions
|
||||
|
||||
import "html/template"
|
||||
|
||||
func FirstLetter(s string) string {
|
||||
if len(s) == 0 {
|
||||
return ""
|
||||
}
|
||||
return string(s[:1])
|
||||
}
|
||||
|
||||
func Safe(s string) template.HTML {
|
||||
if len(s) == 0 {
|
||||
return ""
|
||||
}
|
||||
return template.HTML(s)
|
||||
}
|
||||
Reference in New Issue
Block a user