Modern websites have a search bar, searching within the site for specific content. These search boxes often search the database in real-time. That is not possible within a static website. Therefore another solution must be found.

How it works

This search relies on the index from Google. It queries the Google Search engine directly. Results will be shown within the Google interface (on a new page), but will be limited to the site you specified. Click the ‘read more’ link for a demo.


<form method="get" action="" target="_blank"><input type="hidden" name="sitesearch" value="" /><input type="text" name="q" maxlength="255" value="" placeholder="Search via Google" /></form>



Step 1. Download the file search-google.html and change the domain name
Step 2. Save the file in the ‘_includes’ directory of your project
Step 3. Add the following statement to your layout where you want the search box to appear:

{% include search-google.html %}