Skip to content

Commit 55b1b2d

Browse files
committed
Update protosearch, exclude the 404 page
1 parent 5251c66 commit 55b1b2d

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

build.scala

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//> using dep org.graalvm.js:js:25.0.2
55
//> using dep org.webjars.npm:katex:0.16.44
66
//> using dep org.webjars.npm:fortawesome__fontawesome-free:7.2.0
7-
//> using dep pink.cozydev::protosearch-laika:0.0-7f79720-SNAPSHOT
7+
//> using dep pink.cozydev::protosearch-laika:0.0-bbb1740-SNAPSHOT
88
//> using repository https://central.sonatype.com/repository/maven-snapshots
99
//> using option -deprecation
1010

@@ -77,9 +77,12 @@ object LaikaBuild {
7777
import laika.io.syntax.*
7878
import laika.parse.code.languages.ScalaSyntax
7979
import laika.theme.*
80-
import pink.cozydev.protosearch.analysis.{IndexFormat, IndexRendererConfig}
80+
import pink.cozydev.protosearch.laika.IndexConfig
8181
import pink.cozydev.protosearch.ui.SearchUI
8282

83+
val indexConfig =
84+
IndexConfig.withExcludedPaths(Path.Root / "404.md")
85+
8386
def input = {
8487
val securityPolicy = new URI(
8588
"https://raw.githubusercontent.com/typelevel/.github/refs/heads/main/SECURITY.md"
@@ -128,7 +131,7 @@ object LaikaBuild {
128131
.build
129132

130133
val binaryRenderers = List(
131-
IndexRendererConfig(true),
134+
indexConfig.config,
132135
BinaryRendererConfig(
133136
"rss",
134137
LaikaCustomizations.Rss,
@@ -154,7 +157,7 @@ object LaikaBuild {
154157
.parallel[IO]
155158
.build
156159
val index =
157-
Renderer.of(IndexFormat).withConfig(parser.config).parallel[IO].build
160+
Renderer.of(indexConfig.format).withConfig(parser.config).parallel[IO].build
158161

159162
(html, rss, index).tupled.use { (html, rss, index) =>
160163
parser.fromInput(input).parse.flatMap { tree =>

src/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function hideSearchModal() {
2626
}
2727

2828
function renderHit(hit) {
29-
const link = `${hit.fields.path}.html`
29+
const link = `/${hit.fields.path}.html`
3030
const title = hit.highlights["title"] || hit.fields["title"]
3131
const preview = hit.highlights["body"]
3232
const tags = []

0 commit comments

Comments
 (0)