--- a/example/src/sqwl/cms/Articles.scala Tue Nov 24 13:15:49 2020 +0100
+++ b/example/src/sqwl/cms/Articles.scala Tue Dec 29 16:46:47 2020 +0100
@@ -1,8 +1,23 @@
+/*
+ * Copyright 2018-2020 Tomas Zeman <tomas@functionals.cz>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package sqwl.cms
-import java.nio.file.{Path, Paths}
+import scalatags.Text.all._
+
import scala.collection.mutable
-import scalatags.Text.all._
object Articles {
case class Id(v: String)
@@ -11,10 +26,9 @@
title: String,
category: Option[iCategory],
tags: Seq[iTag] = Seq(),
- htmlContent: String,
+ htmlContent: SeqFrag[Frag],
rank: Int = 0
) extends iArticle {
- override def assets: Path = Paths.get(s"example/content/${id.v}")
override def pathSegment: String = id.v
}
private val all = mutable.ArrayBuffer[iArticle]()
@@ -24,7 +38,7 @@
def article(title: String, cat: iCategory, tags: Seq[iTag] = Seq(),
rank: Int = 0)(body: Frag*)(implicit articleId: Id): SeqFrag[Frag] = {
- all += Article(articleId, title, Option(cat), tags, body.render, rank)
+ all += Article(articleId, title, Option(cat), tags, body, rank)
body
}
}