You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

base.go 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // Copyright 2022 The Gitea Authors. All rights reserved.
  2. // SPDX-License-Identifier: MIT
  3. package options
  4. import (
  5. "code.gitea.io/gitea/modules/assetfs"
  6. "code.gitea.io/gitea/modules/setting"
  7. )
  8. func CustomAssets() *assetfs.Layer {
  9. return assetfs.Local("custom", setting.CustomPath, "options")
  10. }
  11. func AssetFS() *assetfs.LayeredFS {
  12. return assetfs.Layered(CustomAssets(), BuiltinAssets())
  13. }
  14. // Locale reads the content of a specific locale from static/bindata or custom path.
  15. func Locale(name string) ([]byte, error) {
  16. return AssetFS().ReadFile("locale", name)
  17. }
  18. // Readme reads the content of a specific readme from static/bindata or custom path.
  19. func Readme(name string) ([]byte, error) {
  20. return AssetFS().ReadFile("readme", name)
  21. }
  22. // Gitignore reads the content of a gitignore locale from static/bindata or custom path.
  23. func Gitignore(name string) ([]byte, error) {
  24. return AssetFS().ReadFile("gitignore", name)
  25. }
  26. // License reads the content of a specific license from static/bindata or custom path.
  27. func License(name string) ([]byte, error) {
  28. return AssetFS().ReadFile("license", name)
  29. }
  30. // Labels reads the content of a specific labels from static/bindata or custom path.
  31. func Labels(name string) ([]byte, error) {
  32. return AssetFS().ReadFile("label", name)
  33. }