summaryrefslogtreecommitdiffstats
path: root/modules/public/public.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/public/public.go')
-rw-r--r--modules/public/public.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/modules/public/public.go b/modules/public/public.go
index 9c9e9d533d..6f28ebc032 100644
--- a/modules/public/public.go
+++ b/modules/public/public.go
@@ -4,6 +4,13 @@
package public
+import (
+ "path"
+
+ "code.gitea.io/gitea/modules/setting"
+ "gopkg.in/macaron.v1"
+)
+
//go:generate go-bindata -tags "bindata" -ignore "\\.go|\\.less" -pkg "public" -o "bindata.go" ../../public/...
//go:generate go fmt bindata.go
//go:generate sed -i.bak s/..\/..\/public\/// bindata.go
@@ -14,3 +21,13 @@ type Options struct {
Directory string
SkipLogging bool
}
+
+// Custom implements the macaron static handler for serving custom assets.
+func Custom(opts *Options) macaron.Handler {
+ return macaron.Static(
+ path.Join(setting.CustomPath, "public"),
+ macaron.StaticOptions{
+ SkipLogging: opts.SkipLogging,
+ },
+ )
+}