Skip to content

Commit 0990bab

Browse files
committed
Exclude empty redirect docs from index
1 parent 8e84b07 commit 0990bab

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

build.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,9 @@ object LaikaBuild {
8080
import pink.cozydev.protosearch.laika.IndexConfig
8181
import pink.cozydev.protosearch.ui.SearchUI
8282

83+
val indexExclusions = Path.Root / "404.md" +: Redirects.paths
8384
val indexConfig =
84-
IndexConfig.withExcludedPaths(Path.Root / "404.md")
85+
IndexConfig.withExcludedPaths(indexExclusions*)
8586

8687
def input = {
8788
val securityPolicy = new URI(
@@ -491,6 +492,8 @@ object Redirects {
491492
tree.addString(mkRedirect(to), Root / (from.stripSuffix(".html") + ".md"))
492493
}
493494

495+
def paths = map.keys.map(p => Root / p.stripSuffix(".html")).toList
496+
494497
private def mkRedirect(to: String) =
495498
s"""{% laika.html.template = "/templates/redirect.template.html", laika.targetFormats: [html], target = "$to" %}"""
496499

0 commit comments

Comments
 (0)