Skip to content

🔍 Search through your jekyll pages, posts, or any collection the ES6 way

License

Notifications You must be signed in to change notification settings

daviddarnes/jekyll-search-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jekyll-search-js

🔍 Search through your jekyll pages, posts, or any collection the ES6 way. See a demo

Installation

  1. Download the source files (src/) or install with npm
  2. Drop these files into your assets/ directory (or preferred directory)
  3. Link the search.js file and fetch.js polyfill:
<script type="text/javascript" src="./src/fetch.js"></script>
<script type="text/javascript" src="./src/search.js"></script>
  1. Initialise a new search:
<script type="text/javascript">

  // New search using example options
  const search = new jekyllSearch(
    'https://alembic.darn.es/assets/search.json',
    '#search',
    '#list',
    'https://alembic.darn.es'
  );

  // Initialise
  search.init();

</script>

Options

const search = new jekyllSearch(
  'https://alembic.darn.es/assets/search.json', // Your data source, can be relative or absolute
  '#search', // The selector of your search input field
  '#list', // The selector of your search results wrapper
  'https://alembic.darn.es' // Optional site url for absolute urls
);

To do

  • Get js into a class
  • Allow options to be set
  • Finish installation readme
  • Add how to be installed using npm
  • Submit to npmjs.com

About

🔍 Search through your jekyll pages, posts, or any collection the ES6 way

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published