0bdd400f by odiel

Update utils.go

Adding Assets functions for the template, to generate HTML tags for JS and CSS
1 parent 8cf34fce
Showing 1 changed file with 19 additions and 0 deletions
...@@ -388,3 +388,22 @@ func GetRandomString(n int) string { ...@@ -388,3 +388,22 @@ func GetRandomString(n int) string {
388 func UrlFor(endpoint string, values ...string) string { 388 func UrlFor(endpoint string, values ...string) string {
389 return BeeApp.UrlFor(endpoint, values...) 389 return BeeApp.UrlFor(endpoint, values...)
390 } 390 }
391
392
393 //This can be changed to a better name
394 func AssetsJs(src string) template.HTML {
395 text := string(src)
396
397 text = "<script src=\""+src+"\"></script>"
398
399 return template.HTML(text)
400 }
401
402 //This can be changed to a better name
403 func AssetsCss(src string) template.HTML {
404 text := string(src)
405
406 text = "<link href=\""+src+"\" rel=\"stylesheet\" />"
407
408 return template.HTML(text)
409 }
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!