Inside supports two search modes: local search (built-in, generates a JSON index at build time) and Algolia (cloud-powered, requires an Algolia account).
Local Search
Local search generates a searchable JSON file from your posts at build time. No external accounts required.
search: # Show search button in the FAB (floating action button, bottom-right) fab:true
# Generate a standalone /search page (add to your sidebar menu) page:true
# Local search adapter adapter: # Which content types to index range: -post -page
# Maximum number of items to index per type # Default: 10000 limit:10000
# Search results per page per_page:10
Step 2: Add search to your menu
1 2
menu: Search:/search
Step 3: Create the search page (if page: true)
1
hexo new page search
Edit source/search/index.md:
1 2 3 4
--- title:Search layout:false ---
The layout: false prevents the page from using the post/page layout, since Inside renders the search UI as a standalone SPA route.
How it works
At hexo generate, Inside writes a JSON index to source/api/search.json. The search SPA reads this file and performs instant full-text search on the client side.
Algolia Search
Algolia provides faster, more sophisticated search with typo tolerance and cloud-synced indexing. Best for sites with hundreds of posts.
keys: data:hits# Path to result array in response current:page# Current page number key total:nbPages# Total pages key hits:nbHits# Total results key time:processingTimeMS# Query time key title:_snippetResult.title.value# Per-result title (with highlights) content:_snippetResult.content.value# Per-result snippet (with highlights)
Step 4: Upload your content to Algolia
You need to push your post data to Algolia’s index. A common approach is a custom Hexo generator script: