Skip to content

Update protosearch, exclude the 404 page#637

Open
valencik wants to merge 3 commits intomainfrom
bump-proto-exclude-404
Open

Update protosearch, exclude the 404 page#637
valencik wants to merge 3 commits intomainfrom
bump-proto-exclude-404

Conversation

@valencik
Copy link
Copy Markdown
Member

@valencik valencik commented Apr 16, 2026

Updates to latest protosearch snapshot, which let's us exclude paths and specify our config just once.

Excluding the 404 page

Before:
image

After:
image

@valencik valencik self-assigned this Apr 16, 2026
Comment thread build.scala Outdated
Comment on lines +83 to +84
val indexConfig =
IndexConfig.withExcludedPaths(Path.Root / "404.md")
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this part is neat, we can define the config and settings once and then access the BinaryRendererConfig with indexConfig.config and the TwoPhaseRenderFormat for Transformers with indexConfig.format.

Comment thread src/main.js

function renderHit(hit) {
const link = `${hit.fields.path}.html`
const link = `/${hit.fields.path}.html`
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because the path field no longer has the leading slash.
Which means queries like path:blog now work

@valencik valencik requested a review from armanbilge April 16, 2026 00:49
Comment thread build.scala
tree.addString(mkRedirect(to), Root / (from.stripSuffix(".html") + ".md"))
}

def paths = map.keys.map(p => Root / p.stripSuffix(".html")).toList
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we can exclude these empty redirect documents from the index.
They all end up with the same name index.txt because index.md becomes index.txt after "plaintext" formatting in the Index renderer.

This is from the live site:

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant