Skip to content

A plugin to generate a search.json to be used with Simple-Jekyll-Search

License

Notifications You must be signed in to change notification settings

valantonini/wintersmith-search

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wintersmith-search

Build Status npm npm

A plugin to generate a search.json to be used with Simple-Jekyll-Search.

Requires wintersmith-contents

npm install wintersmith-contents --save
npm install wintersmith-search --save
  "plugins": [
    "wintersmith-contents",
    "wintersmith-search"
  ]

sample search page

extends layout

block append head
    script(src="https://unpkg.com/[email protected]/dest/simple-jekyll-search.min.js")
    script.
        document.addEventListener("DOMContentLoaded", function () {
        var sjs = SimpleJekyllSearch({
        searchInput: document.getElementById('searchInput'),
        resultsContainer: document.getElementById('resultsContainer'),
        json: '/search.json'
        });
        document.getElementById('searchInput').focus();
        });

block content
    .search
        h1 search
        input#searchInput(type='text', placeholder='Search blog posts..')
        ul#resultsContainer

About

A plugin to generate a search.json to be used with Simple-Jekyll-Search

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages