Skip to content

Commit 5b9cb6c

Browse files
authored
Merge pull request #672 from typelevel/bump-proto-jul24
Bump protosearch to latest snapshot
2 parents dd90c8c + cb5e771 commit 5b9cb6c

2 files changed

Lines changed: 15 additions & 6 deletions

File tree

‎build.scala‎

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//> using dep org.graalvm.js:js:25.1.3
55
//> using dep org.webjars.npm:katex:0.17.0
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-0aa7335-SNAPSHOT
88
//> using repository https://central.sonatype.com/repository/maven-snapshots
99
//> using option -deprecation
1010

@@ -77,9 +77,11 @@ 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 = IndexConfig.default
84+
8385
def input = {
8486
val securityPolicy = new URI(
8587
"https://raw.githubusercontent.com/typelevel/.github/refs/heads/main/SECURITY.md"
@@ -128,7 +130,7 @@ object LaikaBuild {
128130
.build
129131

130132
val binaryRenderers = List(
131-
IndexRendererConfig(true),
133+
indexConfig.config,
132134
BinaryRendererConfig(
133135
"rss",
134136
LaikaCustomizations.Rss,
@@ -154,7 +156,11 @@ object LaikaBuild {
154156
.parallel[IO]
155157
.build
156158
val index =
157-
Renderer.of(IndexFormat).withConfig(parser.config).parallel[IO].build
159+
Renderer
160+
.of(indexConfig.format)
161+
.withConfig(parser.config)
162+
.parallel[IO]
163+
.build
158164

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

‎src/main.js‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ function hideSearchModal() {
3232
}
3333

3434
function renderHit(hit) {
35-
const link = `${hit.fields.path}.html`
35+
const link = `/${hit.fields.path}.html`
3636
const title = hit.highlights["title"] || hit.fields["title"]
3737
const preview = hit.highlights["body"]
3838
const tags = []
@@ -62,7 +62,10 @@ searchWorker.onmessage = function (e) {
6262
}
6363

6464
function onSearchInput(event) {
65-
searchWorker.postMessage({"query": event.target.value || ""});
65+
searchWorker.postMessage({
66+
"query": event.target.value || "",
67+
"size": 50
68+
});
6669
}
6770

6871
// Keyboard shortcuts: `/` to open, `Escape` to close

0 commit comments

Comments
 (0)