@@ -127,7 +127,9 @@ case class Site(
127
127
}
128
128
129
129
/** Copy static files to `outDir` */
130
- def copyStaticFiles (outDir : JFile = new JFile (root.getAbsolutePath + " /_site" ))(implicit ctx : Context ): this .type =
130
+ private [this ] val defaultOutDir = new JFile (root.getAbsolutePath + JFile .separator + " _site" )
131
+
132
+ def copyStaticFiles (outDir : JFile = defaultOutDir)(implicit ctx : Context ): this .type =
131
133
createOutput (outDir) {
132
134
// Copy user-defined static assets
133
135
staticAssets.foreach { asset =>
@@ -188,7 +190,7 @@ case class Site(
188
190
}
189
191
190
192
/** Generate HTML for the API documentation */
191
- def generateApiDocs (outDir : JFile = new JFile (root.getAbsolutePath + " /_site " ) )(implicit ctx : Context ): this .type =
193
+ def generateApiDocs (outDir : JFile = defaultOutDir )(implicit ctx : Context ): this .type =
192
194
createOutput(outDir) {
193
195
def genDoc (e : model.Entity ): Unit = {
194
196
ctx.docbase.echo(s " Generating doc page for: ${e.path.mkString(" ." )}" )
@@ -198,7 +200,11 @@ case class Site(
198
200
if (e.kind == " package" ) (" /index.html" , - 1 )
199
201
else (" .html" , 0 )
200
202
201
- val target = mkdirs(fs.getPath(outDir.getAbsolutePath + " /api/" + e.path.mkString(" /" ) + suffix))
203
+ val path = if (scala.util.Properties .isWin)
204
+ e.path.map(_.replace(" <" , " _" ).replace(" >" , " _" ))
205
+ else
206
+ e.path
207
+ val target = mkdirs(fs.getPath(outDir.getAbsolutePath + " /api/" + path.mkString(" /" ) + suffix))
202
208
val params = defaultParams(target.toFile, - 1 ).withPosts(blogInfo).withEntity(Some (e)).toMap
203
209
val page = new HtmlPage (" _layouts/api-page.html" , layouts(" api-page" ).content, params, includes)
204
210
@@ -230,7 +236,7 @@ case class Site(
230
236
}
231
237
232
238
/** Generate HTML files from markdown and .html sources */
233
- def generateHtmlFiles (outDir : JFile = new JFile (root.getAbsolutePath + " /_site " ) )(implicit ctx : Context ): this .type =
239
+ def generateHtmlFiles (outDir : JFile = defaultOutDir )(implicit ctx : Context ): this .type =
234
240
createOutput(outDir) {
235
241
compilableFiles.foreach { asset =>
236
242
val pathFromRoot = stripRoot(asset)
@@ -250,7 +256,7 @@ case class Site(
250
256
}
251
257
252
258
/** Generate blog from files in `blog/_posts` and output in `outDir` */
253
- def generateBlog (outDir : JFile = new JFile (root.getAbsolutePath + " /_site " ) )(implicit ctx : Context ): this .type =
259
+ def generateBlog (outDir : JFile = defaultOutDir )(implicit ctx : Context ): this .type =
254
260
createOutput(outDir) {
255
261
blogposts.foreach { file =>
256
262
val BlogPost .extract(year, month, day, name, ext) = file.getName
0 commit comments