theme.go 593 B

1234567891011121314151617181920212223242526
  1. // Copyright 2017 Frédéric Guillot. All rights reserved.
  2. // Use of this source code is governed by the Apache 2.0
  3. // license that can be found in the LICENSE file.
  4. package model
  5. import "github.com/miniflux/miniflux/errors"
  6. // Themes returns the list of available themes.
  7. func Themes() map[string]string {
  8. return map[string]string{
  9. "default": "Default",
  10. "black": "Black",
  11. }
  12. }
  13. // ValidateTheme validates theme value.
  14. func ValidateTheme(theme string) error {
  15. for key := range Themes() {
  16. if key == theme {
  17. return nil
  18. }
  19. }
  20. return errors.NewLocalizedError("Invalid theme")
  21. }