summaryrefslogtreecommitdiffstats
path: root/services/webhook/shared/img.go
blob: 2d65ba4e0fff50dfe4beb293d13778ff0e25a1e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
package shared

import (
	"html"
	"html/template"
	"strconv"

	"code.gitea.io/gitea/modules/setting"
)

func ImgIcon(name string, size int) template.HTML {
	s := strconv.Itoa(size)
	src := html.EscapeString(setting.StaticURLPrefix + "/assets/img/" + name)
	return template.HTML(`<img width="` + s + `" height="` + s + `" src="` + src + `">`)
}