how to make github pages searchable

How to Make GitHub Pages Searchable: A Step-by-Step Guide

By Robert Davis
AD

Using GitHub Pages for your personal or project website is a great way to establish an online presence. However, by default, GitHub Pages sites are not searchable. To make your GitHub Pages site searchable, you'll need to implement a search function. One of the most popular options is using Lunr.js, a tiny, powerful, and easy-to-use full-text search library.

In this guide, we'll walk through the process of adding Lunr.js to your GitHub Pages site and creating a simple search box and results page. This will make your site more user-friendly and boost its SEO by improving discoverability.

Setting up Lunr.js for GitHub Pages

Before you begin, ensure you have a GitHub Pages site set up. If you don't, you can follow GitHub's guide to create one.

AD
How to Publish Website on Github Pages in Three Simple Steps
How to Publish Website on Github Pages in Three Simple Steps
How to Get Started With GitHub in 2026 and Build Real Projects Fast
How to Get Started With GitHub in 2026 and Build Real Projects Fast
How To Create A GitHub User Search Web App Using Vue.js
How To Create A GitHub User Search Web App Using Vue.js

Once your site is ready, we'll start by including Lunr.js in our project. We'll use the version hosted on a CDN to keep our project lightweight.

Including Lunr.js in your Project

In your project's main HTML file (usually `index.html`), add the following script tag just before the closing `` tag:

How to Host a Website for Free Using GitHub Pages
How to Host a Website for Free Using GitHub Pages
How to Create a Github Page for Your Project
How to Create a Github Page for Your Project
```html
AD