base/src/sqwl/cms/FsArticle.scala
author Tomas Zeman <tzeman@volny.cz>
Tue, 11 Dec 2018 21:33:20 +0100
changeset 16 4556852613a9
parent 15 1e1b0a1a4d63
permissions -rw-r--r--
Scalatex based article implementation
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
15
1e1b0a1a4d63 Filesystem based article implementation
Tomas Zeman <tzeman@volny.cz>
parents:
diff changeset
     1
package sqwl.cms
1e1b0a1a4d63 Filesystem based article implementation
Tomas Zeman <tzeman@volny.cz>
parents:
diff changeset
     2
1e1b0a1a4d63 Filesystem based article implementation
Tomas Zeman <tzeman@volny.cz>
parents:
diff changeset
     3
import java.nio.file.Path
1e1b0a1a4d63 Filesystem based article implementation
Tomas Zeman <tzeman@volny.cz>
parents:
diff changeset
     4
1e1b0a1a4d63 Filesystem based article implementation
Tomas Zeman <tzeman@volny.cz>
parents:
diff changeset
     5
trait FsArticle extends iArticle {
1e1b0a1a4d63 Filesystem based article implementation
Tomas Zeman <tzeman@volny.cz>
parents:
diff changeset
     6
1e1b0a1a4d63 Filesystem based article implementation
Tomas Zeman <tzeman@volny.cz>
parents:
diff changeset
     7
  protected def contentPath: Path
1e1b0a1a4d63 Filesystem based article implementation
Tomas Zeman <tzeman@volny.cz>
parents:
diff changeset
     8
  protected def encoding: String = "UTF-8"
1e1b0a1a4d63 Filesystem based article implementation
Tomas Zeman <tzeman@volny.cz>
parents:
diff changeset
     9
16
4556852613a9 Scalatex based article implementation
Tomas Zeman <tzeman@volny.cz>
parents: 15
diff changeset
    10
  override def htmlContent: String =
4556852613a9 Scalatex based article implementation
Tomas Zeman <tzeman@volny.cz>
parents: 15
diff changeset
    11
    readFile(contentPath, encoding) getOrElse ""
15
1e1b0a1a4d63 Filesystem based article implementation
Tomas Zeman <tzeman@volny.cz>
parents:
diff changeset
    12
}