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
990 B

package model
import (
"strings"
)
// PageCategory represents a page category
type PageCategory struct {
Key string
Plural string
Icon string
}
// URLRoot is the "folder" used for searching within the category
func (category *PageCategory) URLRoot() string {
return strings.ToLower(category.Plural)
}
// PageCategories are used by the view model and page to enforce
// a limited selection of categories. I may move it to a configuration
// or the database, but for now I think this list is pretty fixed
var PageCategories = []PageCategory{
{"OoC", "OoC", "ooc"},
{"Info", "Info", "info"},
{"News", "News", "news"},
{"Item", "Items", "item"},
{"Document", "Documents", "document"},
{"Background", "Background", "background"},
{"Story", "Stories", "story"},
}
var pageCategories []string
// init setups pageCategories
func init() {
pageCategories := make([]string, len(PageCategories))
for i, category := range PageCategories {
pageCategories[i] = category.Key
}
}