The backend for the AiteStory website
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.

39 lines
989 B

  1. package model
  2. import (
  3. "strings"
  4. )
  5. // PageCategory represents a page category
  6. type PageCategory struct {
  7. Key string
  8. Plural string
  9. Icon string
  10. }
  11. // URLRoot is the "folder" used for searching within the category
  12. func (category *PageCategory) URLRoot() string {
  13. return strings.ToLower(category.Plural)
  14. }
  15. // PageCategories are used by the view model and page to enforce
  16. // a limited selection of categories. I may move it to a configuration
  17. // or the database, but for now I think this list is pretty fixed
  18. var PageCategories = []PageCategory{
  19. {"OoC", "OoC", "ooc"},
  20. {"Info", "Info", "info"},
  21. {"News", "News", "news"},
  22. {"Item", "Items", "item"},
  23. {"Document", "Documents", "document"},
  24. {"Background", "Background", "background"},
  25. {"Story", "Stories", "story"},
  26. }
  27. var pageCategories []string
  28. // init setups pageCategories
  29. func init() {
  30. pageCategories = make([]string, len(PageCategories))
  31. for i, category := range PageCategories {
  32. pageCategories[i] = category.Key
  33. }
  34. }