mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	@@ -9,6 +9,8 @@ import (
 | 
			
		||||
	"encoding/json"
 | 
			
		||||
	"fmt"
 | 
			
		||||
	"html/template"
 | 
			
		||||
	"mime"
 | 
			
		||||
	"path/filepath"
 | 
			
		||||
	"runtime"
 | 
			
		||||
	"strings"
 | 
			
		||||
	"time"
 | 
			
		||||
@@ -103,6 +105,10 @@ func NewFuncMap() []template.FuncMap {
 | 
			
		||||
		"ThemeColorMetaTag": func() string {
 | 
			
		||||
			return setting.UI.ThemeColorMetaTag
 | 
			
		||||
		},
 | 
			
		||||
		"FilenameIsImage": func(filename string) bool {
 | 
			
		||||
			mimeType := mime.TypeByExtension(filepath.Ext(filename))
 | 
			
		||||
			return strings.HasPrefix(mimeType, "image/")
 | 
			
		||||
		},
 | 
			
		||||
	}}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user