Skip to content

Commit 2b80cff

Browse files
committed
Added support to excludeDotHTML and made it the new default
1 parent 90565f9 commit 2b80cff

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

build.sbt

+8-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,14 @@ lazy val template = crossApplication.in(file("."))
3737
"org.powerscala" %% "powerscala-io" % powerScala,
3838
"io.bit3" % "jsass" % jsass
3939
),
40-
assemblyJarName in assembly := "youi-template.jar"
40+
assemblyJarName in assembly := "youi-template.jar",
41+
assemblyMergeStrategy in assembly := {
42+
case "javax/annotation/Nonnull$Checker.class" => MergeStrategy.first
43+
case "javax/annotation/meta/When.class" => MergeStrategy.first
44+
case x =>
45+
val oldStrategy = (assemblyMergeStrategy in assembly).value
46+
oldStrategy(x)
47+
}
4148
)
4249
lazy val templateJS = template.js
4350
lazy val templateJVM = template.jvm

js/src/main/scala/io/youi/template/ClientTemplateApplication.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ object ClientTemplateApplication extends TemplateApplication with ClientApplicat
1818
def main(): Unit = {
1919
ActivationSupport.debug = true
2020
val paths = pages.map { page =>
21-
s"/${page.substring(0, page.indexOf('.'))}"
21+
s"/$page"
2222
}
2323
paths.map { p =>
2424
new TemplateScreen(Path.parse(p))

jvm/src/main/scala/io/youi/template/TemplateCompiler.scala

+5-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,11 @@ class TemplateCompiler(val sourceDirectory: File,
123123
// TODO: support HTML minification
124124

125125
synchronized {
126-
pages += fileName
126+
if (removeDotHTML) {
127+
pages += (fileName.substring(0, fileName.indexOf('.')))
128+
} else {
129+
pages += fileName
130+
}
127131
}
128132
}
129133

0 commit comments

Comments
 (0)