mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-29 10:57:44 +09:00 
			
		
		
		
	Refactor embedded assets and drop unnecessary dependencies (#34692)
Benefits: 1. smaller binary size (reduces more than 1MB) 2. better control of the assets details 3. fewer unmaintained dependencies 4. faster startup if the assets are not needed 5. won't hang up editors when open "bindata.go" by accident
This commit is contained in:
		
							
								
								
									
										15
									
								
								modules/templates/templates_dynamic.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								modules/templates/templates_dynamic.go
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,15 @@ | ||||
| // Copyright 2016 The Gitea Authors. All rights reserved. | ||||
| // SPDX-License-Identifier: MIT | ||||
|  | ||||
| //go:build !bindata | ||||
|  | ||||
| package templates | ||||
|  | ||||
| import ( | ||||
| 	"code.gitea.io/gitea/modules/assetfs" | ||||
| 	"code.gitea.io/gitea/modules/setting" | ||||
| ) | ||||
|  | ||||
| func BuiltinAssets() *assetfs.Layer { | ||||
| 	return assetfs.Local("builtin(static)", setting.StaticRootPath, "templates") | ||||
| } | ||||
		Reference in New Issue
	
	Block a user