@@ -3,6 +3,7 @@ package site
3
3
4
4
import java .io .File
5
5
import java .nio .file .Files
6
+ import java .nio .file .FileVisitOption
6
7
7
8
import org .jetbrains .dokka .base .renderers .html .{NavigationNode , NavigationPage }
8
9
import org .jetbrains .dokka .links .DRI
@@ -25,18 +26,20 @@ class SiteResourceManager(ctx: Option[StaticSiteContext]) extends BaseStaticSite
25
26
}.toSet
26
27
27
28
override def transform (input : RootPageNode , ctx : StaticSiteContext ): RootPageNode =
28
- val imgPath = ctx.root.toPath().resolve(" images" )
29
+ val rootPath = ctx.root.toPath
30
+ val imgPath = rootPath.resolve(" images" )
29
31
val images =
30
32
if ! Files .exists(imgPath) then Nil
31
33
else
32
- val stream = Files .walk(imgPath)filter(p => Files .isRegularFile(p) && p.getFileName().toString().endsWith(" .svg" ))
33
- stream.iterator().asScala.toList.map(_.toString)
34
+ val allPaths = Files .walk(imgPath, FileVisitOption .FOLLOW_LINKS )
35
+ val files = allPaths.filter(Files .isRegularFile(_)).iterator().asScala
36
+ files.map(p => rootPath.relativize(p).toString).toList
34
37
35
- val resources = listResources(input.getChildren.asScala.toList) ++ images
38
+ val resources = images ++ listResources(input.getChildren.asScala.toList)
36
39
val resourcePages = resources.map { path =>
37
- val content = Files .readAllLines(ctx.root.toPath. resolve(path)).asScala.mkString( " \n " )
38
- new RendererSpecificResourcePage (path, JList (), new RenderingStrategy . Write (content) )
39
- }.toList
40
+ val strategy = new RenderingStrategy . Copy (rootPath. resolve(path).toString )
41
+ new RendererSpecificResourcePage (path, JList (), strategy )
42
+ }
40
43
41
44
val modified = input.transformContentPagesTree {
42
45
case it : StaticPageNode =>
0 commit comments