StaticSearch v0.8.0 update

By Craig Buckler

401 words, 3-minute read

search
Image courtesy of Agence Olloweb

StaticSearch v0.8.0 was released on . There should be no breaking changes.

Single <script> tag #

After indexing a site, search functionality can be added to any page with a single <script> tag:

template excerpt

<script type="module" src="/search/staticsearch-here.js"></script>

This automatically loads the web component and puts a search icon on the page at the script’s DOM location. You could add it to the HTML <header> in your site’s templates.

Refer to the web component documentation for template and styling options.

Improved logging #

The indexer detects when StaticSearch code is present in HTML pages and provides inclusion instructions when necessary.

Better minimum font size #

The web component dialog font size is set to the largest of 1em or 16px. You can override this by setting a --staticsearch-fontsize custom property in your CSS.

Safari keyboard support #

Pressing Esc closes the web component dialog on Safari when the search field is empty. Other browsers already supported this without JavaScript.

Powered by StaticSearch #

A “powered by StaticSearch” link now appears at the bottom of the web component dialog. You can style or remove the link using CSS:

static-search::(poweredby) {
  display: none;
}

Miscellaneous updates #

Minor changes include:

Get started #

The StaticSearch documentation provides a quick start guide, and details about the indexer, single script tag, web component,web component, bind module, and JavaScript API.

StaticSearch works well with Publican sites. The Publican documentation provides a quick start guide, a detailed set-up guide, API references, and common recipes you can use and adapt for your own projects.