@@ -8,6 +8,7 @@ import java.io.{ File => JFile, OutputStreamWriter, BufferedWriter, ByteArrayInp
88import java .util .{ List => JList , Arrays }
99import java .nio .file .Path
1010import java .nio .charset .StandardCharsets
11+ import java .io .File .{ separator => sep }
1112
1213import com .vladsch .flexmark .parser .ParserEmulationProfile
1314import com .vladsch .flexmark .parser .Parser
@@ -166,8 +167,8 @@ case class Site(
166167 private def defaultParams (pageLocation : JFile , additionalDepth : Int = 0 ): DefaultParams = {
167168 val pathFromRoot = stripRoot(pageLocation)
168169 val baseUrl : String = {
169- val rootLen = root.getAbsolutePath.split('/' ).length
170- val assetLen = pageLocation.getAbsolutePath.split('/' ).length
170+ val rootLen = root.getAbsolutePath.split(sep ).length
171+ val assetLen = pageLocation.getAbsolutePath.split(sep ).length
171172 " ../" * (assetLen - rootLen - 1 + additionalDepth) + " ."
172173 }
173174
@@ -197,16 +198,16 @@ case class Site(
197198 // Suffix is index.html for packages and therefore the additional depth
198199 // is increased by 1
199200 val (suffix, offset) =
200- if (e.kind == " package" ) (" / index.html" , - 1 )
201+ if (e.kind == " package" ) (sep + " index.html" , - 1 )
201202 else (" .html" , 0 )
202203
203204 val path = if (scala.util.Properties .isWin)
204205 e.path.map(_.replace(" <" , " _" ).replace(" >" , " _" ))
205206 else
206207 e.path
207- val target = mkdirs(fs.getPath(outDir.getAbsolutePath + " / api/ " + path.mkString(" / " ) + suffix))
208+ val target = mkdirs(fs.getPath(outDir.getAbsolutePath + sep + " api" + sep + path.mkString(sep ) + suffix))
208209 val params = defaultParams(target.toFile, - 1 ).withPosts(blogInfo).withEntity(Some (e)).toMap
209- val page = new HtmlPage (" _layouts/ api-page.html" , layouts(" api-page" ).content, params, includes)
210+ val page = new HtmlPage (" _layouts" + sep + " api-page.html" , layouts(" api-page" ).content, params, includes)
210211
211212 render(page).foreach { rendered =>
212213 val source = new ByteArrayInputStream (rendered.getBytes(StandardCharsets .UTF_8 ))
@@ -223,9 +224,9 @@ case class Site(
223224 }
224225
225226 // generate search page:
226- val target = mkdirs(fs.getPath(outDir.getAbsolutePath + " / api/ search.html" ))
227+ val target = mkdirs(fs.getPath(outDir.getAbsolutePath + sep + " api" + sep + " search.html" ))
227228 val searchPageParams = defaultParams(target.toFile, - 1 ).withPosts(blogInfo).toMap
228- val searchPage = new HtmlPage (" _layouts/ search.html" , layouts(" search" ).content, searchPageParams, includes)
229+ val searchPage = new HtmlPage (" _layouts" + sep + " search.html" , layouts(" search" ).content, searchPageParams, includes)
229230 render(searchPage).foreach { rendered =>
230231 Files .copy(
231232 new ByteArrayInputStream (rendered.getBytes(StandardCharsets .UTF_8 )),
0 commit comments