3.1.2 • Published 3 years ago

ghost-finder v3.1.2

Weekly downloads
2
License
MIT
Repository
github
Last release
3 years ago

Ghost Finder

npm.io npm.io npm.io npm.io npm.io

Installation

npm install ghost-finder

OR

download Download Latest Release

Include script

<script src="{{asset "ghost-finder/dist/ghost-finder.js"}}"></script>

Setup markup

<div>
  <input id="search-input" type="text" placeholder="Type to search" />
  <div id="search-result"></div>
</div>

Activate the plugin

new GhostFinder({
    input: '#search-input',
    showResult: '#search-result',
    contentApiKey: //CONTENT API KEY...,
})

To see how you can get contentApiKey , Click Here


Options

NameDefault ValueDetails
inputnull RequiredDOM selector of search input
showResultnull RequiredDOM selector where search result will be pluged-in
homeUrlcurrent website urlYour ghost site url
contentApiKeynull Requiredcontent api key
resultTemplatesee bellowResult wrapper template for search result
singleResultTemplatesee bellowSingle search result template
excerpt_length250word count to show in ##excerpt variable
time_format'MMMM dd yyyy'Time format string for ##published_at variable. Available formats

Default templates

Result Template

<ul class="search-results-wrapper">
  <p>Search match(es): ##resultCount</p>
  ##results
</ul>

Single Result Template

<li><a href="##url">##title</a></li>

Variables

Field NamePurpose
##titlePost title
##urlPost url
##primary_tag_nameName of primary tag
##primary_tag_urlUrl of primary tag
##primary_author_nameName of primary author
##primary_author_urlProfile url of primary author
##primary_author_avaterProfile photo of primary author
##excerptshow some words of the post content. Default words count is 15
##published_atPost publication date. Format can be change by time_format option
##feature_imagePost featured image url
##resultCountMatched result count

Logs

3.1.2

3 years ago

3.1.1

3 years ago

3.0.1

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago