equal
deleted
inserted
replaced
2 |
2 |
3 import java.nio.file.Path |
3 import java.nio.file.Path |
4 |
4 |
5 import scala.io.Source |
5 import scala.io.Source |
6 import scala.util.{Failure, Success, Try} |
6 import scala.util.{Failure, Success, Try} |
|
7 import scalatags.Text.all._ |
7 |
8 |
8 package object cms { |
9 package object cms { |
9 |
10 |
10 def readSourceFull(src: Source): Try[String] = { |
11 def readSourceFull(src: Source): Try[String] = { |
11 try { |
12 try { |
21 readSourceFull(Source.fromFile(f.toFile, enc)) |
22 readSourceFull(Source.fromFile(f.toFile, enc)) |
22 |
23 |
23 def readFile(f: String): String = |
24 def readFile(f: String): String = |
24 readSourceFull(Source.fromFile(f, "UTF-8")) getOrElse "" |
25 readSourceFull(Source.fromFile(f, "UTF-8")) getOrElse "" |
25 |
26 |
|
27 def lnk(name: String, customUrl: String = ""): Frag = { |
|
28 val usedUrl = if (customUrl == "") name else customUrl |
|
29 a(name, href := usedUrl) |
|
30 } |
26 } |
31 } |