From 86fdba177ad82f3dcdfc237631fef4588042b9d6 Mon Sep 17 00:00:00 2001 From: John Olheiser <42128690+jolheiser@users.noreply.github.com> Date: Tue, 11 Feb 2020 11:02:41 -0600 Subject: Add Octicon SVG spritemap (#10107) * Add octicon SVG sprite Signed-off-by: jolheiser * Static prefix Signed-off-by: jolheiser * SVG for all repo icons Signed-off-by: jolheiser * make vendor Signed-off-by: jolheiser * Swap out octicons Signed-off-by: jolheiser * Move octicons to top of less imports Signed-off-by: jolheiser * Fix JS Signed-off-by: jolheiser * Definitely not a search/replace Signed-off-by: jolheiser * Missed regex Signed-off-by: jolheiser * Move to more generic calls and webpack Signed-off-by: jolheiser * make svg -> make webpack Signed-off-by: jolheiser * Remove svg-sprite Signed-off-by: jolheiser * Update tests Signed-off-by: jolheiser * Missed a test Signed-off-by: jolheiser * Remove svg from makefile Signed-off-by: jolheiser * Suggestions Signed-off-by: jolheiser * Attempt to fix test Signed-off-by: jolheiser * Update tests Signed-off-by: jolheiser * Revert timetracking test Signed-off-by: jolheiser * Swap .octicon for .svg in less Signed-off-by: jolheiser * Add aria-hidden Signed-off-by: jolheiser * Replace mega-octicon Signed-off-by: jolheiser * Fix webpack globbing on Windows Signed-off-by: jolheiser * Revert Co-Authored-By: silverwind * Fix octions from upstream Signed-off-by: jolheiser * Fix Vue and missed JS function Signed-off-by: jolheiser * Add JS helper and PWA Signed-off-by: jolheiser * Preload SVG Signed-off-by: jolheiser Co-authored-by: silverwind Co-authored-by: techknowlogick --- modules/templates/helper.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'modules/templates/helper.go') diff --git a/modules/templates/helper.go b/modules/templates/helper.go index 741161eb8b..30ca9c1638 100644 --- a/modules/templates/helper.go +++ b/modules/templates/helper.go @@ -286,6 +286,9 @@ func NewFuncMap() []template.FuncMap { } return false }, + "svg": func(icon string, size int) template.HTML { + return template.HTML(fmt.Sprintf(``, icon, size, size, setting.StaticURLPrefix, icon)) + }, }} } -- cgit v1.2.3