36 case object Tag4 extends Tag("Tag 4") |
36 case object Tag4 extends Tag("Tag 4") |
37 case object Tag5 extends Tag("Tag 5") |
37 case object Tag5 extends Tag("Tag 5") |
38 case object Tag6 extends Tag("Tag 6") |
38 case object Tag6 extends Tag("Tag 6") |
39 } |
39 } |
40 |
40 |
41 object Content extends iContent { |
41 class Content(val root: Path) extends iContent { |
42 InitializeContent() |
42 InitializeContent() |
43 |
43 |
44 def appTitle: String = "Content management system example" |
44 def appTitle: String = "Content management system example" |
45 |
45 |
46 def appTitleShort: String = "CMS" |
46 def appTitleShort: String = "CMS" |
47 |
47 |
48 def icon: (String, Path) = |
48 def icon: (String, Path) = |
49 ("icon.png", Paths.get("example/content/public/images/icon.png")) |
49 ("icon.png", root.resolve("public/images/icon.png")) |
50 |
50 |
51 def publicAssets: Path = Paths.get("example/content/public") |
51 def publicAssets: Path = root.resolve("public") |
52 |
52 |
53 def styleSheet: (String, Path) = |
53 def styleSheet: (String, Path) = |
54 ("site.css", Paths.get("example/content/public/css/site.css")) |
54 ("site.css", root.resolve("public/css/site.css")) |
55 |
55 |
56 def articlesByTag(t: iTag): Seq[iArticle] = |
56 def articlesByTag(t: iTag): Seq[iArticle] = |
57 Articles.values filter(_.tags contains t) sortBy(_.rank) |
57 Articles.values filter(_.tags contains t) sortBy(_.rank) |
58 |
58 |
59 def articlesByCategory(c: iCategory): Seq[iArticle] = |
59 def articlesByCategory(c: iCategory): Seq[iArticle] = |