Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

123456789101112131415161718192021222324252627282930313233
  1. // Copyright 2016 The Gitea Authors. All rights reserved.
  2. // Use of this source code is governed by a MIT-style
  3. // license that can be found in the LICENSE file.
  4. package public
  5. import (
  6. "path"
  7. "code.gitea.io/gitea/modules/setting"
  8. "gopkg.in/macaron.v1"
  9. )
  10. //go:generate go-bindata -tags "bindata" -ignore "\\.go|\\.less" -pkg "public" -o "bindata.go" ../../public/...
  11. //go:generate go fmt bindata.go
  12. //go:generate sed -i.bak s/..\/..\/public\/// bindata.go
  13. //go:generate rm -f bindata.go.bak
  14. // Options represents the available options to configure the macaron handler.
  15. type Options struct {
  16. Directory string
  17. SkipLogging bool
  18. }
  19. // Custom implements the macaron static handler for serving custom assets.
  20. func Custom(opts *Options) macaron.Handler {
  21. return macaron.Static(
  22. path.Join(setting.CustomPath, "public"),
  23. macaron.StaticOptions{
  24. SkipLogging: opts.SkipLogging,
  25. },
  26. )
  27. }