Blogr includes a powerful client-side full-text search feature powered by MiniSearch. Search is enabled by default and works entirely in the browser without requiring a server.
- Full-text search - Search across post titles, tags, and content
- Real-time results - Instant search results as you type
- Keyboard navigation - Use
/to focus search, arrow keys to navigate, Enter to open - Smart excerpts - Highlighted search terms in result snippets
- Lazy loading - Search index and library loaded only when needed (configurable)
- Responsive design - Works seamlessly on desktop and mobile
Once your site is built and deployed, readers can:
- Quick search - Use the search bar in the site header
- Keyboard shortcut - Press
/to focus the search input - Navigate results - Use arrow keys to navigate, Enter to open a result
- Tag search - Click on tags in search results to search by that tag
- Clear search - Press Escape to clear and hide results
The search feature can be customized in your blogr.toml:
[search]
# Enable or disable search entirely
enabled = true
# Fields to include in search index
fields = ["title", "tags", "content"]
# Paths to exclude from indexing (relative to posts directory)
exclude = ["drafts/", "private/"]
# Maximum characters to include from post content
max_content_chars = 2000
# Number of words to include in search result excerpts
excerpt_words = 30
# Whether to minify the search index JSON (recommended for production)
minify = true
# Whether to lazy-load search assets (improves initial page load)
lazy_load = true
# Whether to remove common English stopwords (experimental)
remove_stopwords = false
# Custom field boost weights for search scoring
[search.field_boosts]
title = 5.0 # Matches in titles are weighted 5x
tags = 3.0 # Matches in tags are weighted 3x
content = 1.0 # Matches in content have base weight- Index size: Typically 10-50KB for small to medium blogs
- Load time: < 100ms for initial search setup with lazy loading
- Search speed: < 10ms for typical queries on 100+ posts
- Browser support: Works in all modern browsers (IE11+)
Search UI can be customized by modifying theme templates:
- Search input styling via CSS classes
.search-input,.search-results - Result item layout in theme templates
- Search behavior by modifying the generated
search.js
Search not working?
- Ensure
search.enabled = truein your config - Check that
search_index.jsonexists in yourdist/folder after build - Verify JavaScript is enabled in the browser
Large index files?
- Reduce
max_content_charsto limit content per post - Enable
minify = trueto compress the JSON - Consider adding more paths to
excludefor draft content