{"_id":"ghost-search","_rev":"5-568e4efabd3130832ea2ead97617dba2","name":"ghost-search","dist-tags":{"latest":"1.1.0"},"versions":{"0.1.0":{"name":"ghost-search","version":"0.1.0","description":"A simple but powerful search library for Ghost Blogging Platform.","main":"ghost-search.js","scripts":{"dev":"gulp"},"repository":{"type":"git","url":"git+https://github.com/HauntedThemes/ghost-search.git"},"keywords":["ghost","search"],"author":{"name":"Haunted Themes","email":"contact@hauntedthemes.com","url":"https://www.hauntedthemes.com"},"license":"MIT","bugs":{"url":"https://github.com/HauntedThemes/ghost-search/issues"},"homepage":"https://github.com/HauntedThemes/ghost-search","dependencies":{"fuzzysort":"^1.1.4"},"devDependencies":{"@babel/core":"^7.0.1","@babel/preset-env":"^7.0.0","gulp":"^3.9.1","gulp-babel":"^8.0.0","gulp-concat":"^2.6.1","gulp-header-comment":"^0.4.0","gulp-minify":"^3.1.0","gulp-resolve-dependencies":"^2.2.0","gulp-sourcemaps":"^2.6.4"},"gitHead":"612b50c25cf091d5114e15305597b137d6bfffdc","_id":"ghost-search@0.1.0","_npmVersion":"6.4.1","_nodeVersion":"8.12.0","_npmUser":{"name":"hauntedthemes","email":"contact@hauntedthemes.com"},"dist":{"integrity":"sha512-8kr6rx2IwrLd4qAoy28dtUcn5n5XmEu85mHZf7aCGsD1deEKV6W1a11zOO6GknH2LGHQWAFcQhIbbDF5zFnupw==","shasum":"0b5ad2e83b8945f4528029a6b3e6b380f8df344f","tarball":"https://registry.npmjs.org/ghost-search/-/ghost-search-0.1.0.tgz","fileCount":8,"unpackedSize":117139,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbn6lUCRA9TVsSAnZWagAAtzIQAIYnbxYef0qJ4tjFlCtK\nKIk8f5tMsvv23yeoTKEF11Bu6htkTuJOlNIr0UFPtH4DTy0IT6lvbBFFfED+\nBPAuuhbNyR/5n1BrFolIg+6v+jJpm7aQXXdUmDROty7tS0MK9Eph20Ofgpb7\nOqH7K1DwUrc8aLkUKhvwA8VFJ9jcOMiYBU5gwxjOiak4bucolKsezHPGOEBK\nCV307RuhbIGbUNBqDnbf7H9usno5gctJSSFvmhzsQZZv2Z4I5ajRJytraxmG\nTT25KO71vstzAvsc1FFbfraXjhbOBafbqUARxMKMGLf4wnJn+TOfygofRh0Z\nHFSypMkA0FR15idu34M24CKnohSFc9wWooFSrm4sDceFNTiX00OYj3IUkMrs\nwhwo02FrzgWsJ6cXWKR2MqPfJg+d1UbVyQmY9UKEWcwqY+6ewImv3xVLUa+T\nd4KXlzF4eT4r9CmP/YDlb3pEyt8eW240tVnMIMxkjQKkUQzy3Oh9RNEetAZ2\nm7Y3nvAz0TxLwCyCR5rf9ILcr93+mNNEN/rRuegVE0o0BOjK++8kFx/o5YND\n+zx7cVK9asCCLxSI/54lMI3BLYt4GxM9XrW9/aHUduvu+hiywNMt0ZUJH+ur\nS6yMXGXXlT/LFrb6BygTCelfN7uEMIx1+7PSOwxeQyxFUuyPiw/4NmOe9167\nihb7\r\n=quJI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEZ4mfiIGSWIGrkyZg5gKklKkww12Ao6DhpkLjmitd7SAiBQ6SdGGt4AfGwWpSSyyspIALLNK4IrX0hFYsjrdW9OEQ=="}]},"maintainers":[{"name":"hauntedthemes","email":"contact@hauntedthemes.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ghost-search_0.1.0_1537190227374_0.7816295233177046"},"_hasShrinkwrap":false},"0.1.1":{"name":"ghost-search","version":"0.1.1","description":"A simple but powerful search library for Ghost Blogging Platform.","main":"dist/ghost-search.js","scripts":{"dev":"gulp"},"repository":{"type":"git","url":"git+https://github.com/HauntedThemes/ghost-search.git"},"keywords":["ghost","search"],"author":{"name":"Haunted Themes","email":"contact@hauntedthemes.com","url":"https://www.hauntedthemes.com"},"license":"MIT","bugs":{"url":"https://github.com/HauntedThemes/ghost-search/issues"},"homepage":"https://github.com/HauntedThemes/ghost-search","dependencies":{"fuzzysort":"^1.1.4"},"devDependencies":{"@babel/core":"^7.1.6","@babel/preset-env":"^7.1.6","gulp":"^3.9.1","gulp-babel":"^8.0.0","gulp-concat":"^2.6.1","gulp-header-comment":"^0.4.0","gulp-minify":"^3.1.0","gulp-resolve-dependencies":"^2.2.0","gulp-sourcemaps":"^2.6.4"},"gitHead":"61c18f0621caafa2666085dc40914ef93c8588ad","_id":"ghost-search@0.1.1","_npmVersion":"6.4.1","_nodeVersion":"8.12.0","_npmUser":{"name":"hauntedthemes","email":"contact@hauntedthemes.com"},"dist":{"integrity":"sha512-3vM1+jUip0UGMFcc/FWMbeSYrzz6TvkVza3IMyeXpF2N5edH644FgdN/Un3PJ5o15S9l3WZR0DMnJMMRtwlEkw==","shasum":"40f159e78c868d5171efef88c8ba4979bce623bc","tarball":"https://registry.npmjs.org/ghost-search/-/ghost-search-0.1.1.tgz","fileCount":8,"unpackedSize":120796,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb/848CRA9TVsSAnZWagAAOmwP/2R+hAtXKI4Tzzd/KoPZ\ndcsTEpcu2ACOhcfxSZmLFcbvwdQ6LzD/zb+gfgQqKW4iSkvjP88NZjqRvtTC\ntKY2TlENzva7II83u5J6IQeoQdFHy45AY3nlQRQj35Ql3JyTI1Of7JS+lt+I\nV6ub8t98Ezf2Zo8TP8cD00iNNzOd8G8sAc1xUvC//vWGVB0KGvxKPE3+GVqQ\nXyld/e6uAdBJc8s8j6BIw9I/mKMfLBTT/2EOfcEI7p7UsCto9k11Ajy7NXsv\n9C7wzQhdEbZDB3s1M8va1NhDvj9yx49xZ6UVqaKT/jlIlL92+z8pdRg9dL7g\nHBVVSqDgd9Tr0/8sowofCn+OkGj6ZX4cm1szGq6FvleFpj7JGL0Sj9ZYGZNF\naDeByp7N+5xqTssFAArQhB6ONMxn1ezzB3PyL718j9bDDrsgYde2AobHX1nk\nX4zWEFMC5b3T4eDxRE1KdWDfG5k3gZE+xrBFC8D5zY9F7oQiYg34oTq2hDwz\nDzBhHeGXlNyB5eLwE8iJASG1+cQxrhKJHvdOha8y2hDtm3iMPHv3t4kLWwsj\n29SEWTAwiwF0yAyGYycT6DvIELxnD3wPjlOYkwe04jg5Qegg+aeCOUWGZZgy\n7RVlIHL8PsunGHowbYE572SC3aJe50tBEb7OMrR+aKh95nx/WNU0HjRR/PYu\nNi2z\r\n=sHtc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGLjHxthXboNfjQcxmb7fJ69c+1y9E/Aq9SGFY2C7xP6AiBVpW2iaXlaAU1nblK1g91ez9rwC+5W+adMK66KeRtOHQ=="}]},"maintainers":[{"name":"hauntedthemes","email":"contact@hauntedthemes.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ghost-search_0.1.1_1543491131115_0.6098323274723447"},"_hasShrinkwrap":false},"1.0.0":{"name":"ghost-search","version":"1.0.0","description":"A simple but powerful search library for Ghost Blogging Platform.","main":"dist/ghost-search.js","scripts":{"dev":"gulp"},"repository":{"type":"git","url":"git+https://github.com/HauntedThemes/ghost-search.git"},"keywords":["ghost","search"],"author":{"name":"Haunted Themes","email":"contact@hauntedthemes.com","url":"https://www.hauntedthemes.com"},"license":"MIT","bugs":{"url":"https://github.com/HauntedThemes/ghost-search/issues"},"homepage":"https://github.com/HauntedThemes/ghost-search","dependencies":{"fuzzysort":"^1.1.4"},"devDependencies":{"@babel/core":"^7.1.6","@babel/preset-env":"^7.1.6","gulp":"^3.9.1","gulp-babel":"^8.0.0","gulp-concat":"^2.6.1","gulp-header-comment":"^0.4.0","gulp-minify":"^3.1.0","gulp-resolve-dependencies":"^2.2.0","gulp-sourcemaps":"^2.6.4"},"gitHead":"cdfc1ada56fe67b58bd2323193002c40916a881b","_id":"ghost-search@1.0.0","_npmVersion":"6.4.1","_nodeVersion":"8.12.0","_npmUser":{"name":"hauntedthemes","email":"contact@hauntedthemes.com"},"dist":{"integrity":"sha512-Zs8lUXqiIX2k3Yku17ASQ6gETNIfNiovDPc9NNirif3vGPEmUPKyMXgOfI39czi2MFBildjOMuu9UkGuLA7LOA==","shasum":"4354370eb2d1c6c62f7efe9096d3ce2c39b81775","tarball":"https://registry.npmjs.org/ghost-search/-/ghost-search-1.0.0.tgz","fileCount":8,"unpackedSize":105996,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcRcPUCRA9TVsSAnZWagAACK0P/3MPzgpy89LuSxcCfxjF\nIJtxU3HzDPSlbeZQsWMshrg29DiRGV3ISbRZNEYHRv7y539HaDqd5D7HoTCe\noH6iy6l7H45oD++n5e0seVRC+wOubsYTKfnvQ3NLDO7+d9yUnPT9igLVmo7D\nVY6cq7/ceVleWKkZmXw/KJEmbl7HWf9BtHtoxFFzipcHREn/AWLRtj9d0dBn\nKOVM87/N/kNGWFZoJ1kKvznOo950JlzJ1XVJxZgP14Tfe8lTtw6TtLHWmKFh\nOG3Yne+3DRbuTxDLzRVRZ/yOs9Ioz/b42xrmb0DZL4+xFOzkUGo70Zq/ShU/\noQHzxLnbVlUL07TaDXMfnzBpIQvbyJ2YnvXbf24p1pd1VllbnQ1alf8dDxFQ\nnhRszqfKk4tLQ9LmoYQffUZ/6cSIMNUieR8VY9/JMgjZJxo0AZijQI2BOEhh\nDciX6jFhLERGN1GGjVxaDbIuupetJhjYD7ak5kWX6j0qpxP00fU22RXc7L3Z\nBbXz9x6nn5DqAgsosYQVAAN2linEpp1oC2XNDvSRpr1wT37EUDZXiuYJ0H2C\nIF6OatEbsmW4aj2ZKmSFHz6oFAJSYgSC6yrJmccJpMAmgy2951mEI6Aw6O/r\nYfqFen/vocSBEPH+oJM5bfG4up3aFhSB/X9MTkPZjJxggQgrNuki7EpAUFK/\ny6Vx\r\n=ah/c\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB3wm7kDuqtS3ivHv1nbQK+aO4LTwMKSrluJYIl6iAplAiBIrrpdL7bRQvYWQYJd/rHDtUF9MFRLPb3CknPOM8XdoA=="}]},"maintainers":[{"name":"hauntedthemes","email":"contact@hauntedthemes.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ghost-search_1.0.0_1548075988058_0.8644066940616295"},"_hasShrinkwrap":false},"1.0.1":{"name":"ghost-search","version":"1.0.1","description":"A simple but powerful search library for Ghost Blogging Platform.","main":"dist/ghost-search.js","scripts":{"dev":"gulp"},"repository":{"type":"git","url":"git+https://github.com/HauntedThemes/ghost-search.git"},"keywords":["ghost","search"],"author":{"name":"Haunted Themes","email":"contact@hauntedthemes.com","url":"https://www.hauntedthemes.com"},"license":"MIT","bugs":{"url":"https://github.com/HauntedThemes/ghost-search/issues"},"homepage":"https://github.com/HauntedThemes/ghost-search","dependencies":{"fuzzysort":"^1.1.4"},"devDependencies":{"@babel/core":"^7.1.6","@babel/preset-env":"^7.1.6","gulp":"^3.9.1","gulp-babel":"^8.0.0","gulp-concat":"^2.6.1","gulp-header-comment":"^0.4.0","gulp-minify":"^3.1.0","gulp-resolve-dependencies":"^2.2.0","gulp-sourcemaps":"^2.6.4"},"gitHead":"e820cf86ff006eafd40e44f71b07a68470883d23","_id":"ghost-search@1.0.1","_npmVersion":"6.4.1","_nodeVersion":"8.12.0","_npmUser":{"name":"hauntedthemes","email":"contact@hauntedthemes.com"},"dist":{"integrity":"sha512-vQhb5olnJaqvuie/voJXqRsk9itsh7owjqHFRm5GeOlW/vqheMorsFcO8KsEYS0QvTEmJv1x01n0aC1vpozO3g==","shasum":"79c2164fb804a8c36a8f4b9dbb51d1d6a5b182c0","tarball":"https://registry.npmjs.org/ghost-search/-/ghost-search-1.0.1.tgz","fileCount":8,"unpackedSize":105948,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcTsiPCRA9TVsSAnZWagAAIhgQAJzwR5YOVaKTebfgHjyG\noAGB4VVkUEm8/UTrFm6StK98hnLBwU10Of7Liz+0Wkc+PDJLfVT3Mz2qk3HH\nCm4QcDgqkDK0L6auBvKZZrRhCBBphE8PBI1JyqfGBju8Xf5+WidlkiEqGQGZ\nEMVMyuRt5g0Afu0SMXVv8exiHCbl32RKbDBClf0kNk4oKW4pwUZasMfobp6B\nn+AHKQTxASIINK/OcsOpHijNAEoE1pKRWLZPweGiUO77QjIMBhgqXKFShkcI\ntyhma00ToeTKyE4L4Ib7XzRG8LMdwbI/uXdu0edNFo1ke210c41vdzHWfQ3N\nBAPQrDHF9vU9F0u6vopybeuEshsU/AhKN5UsyJCyfmoX/uexHP3KEN8rU9+7\n3EksAZM5b9/5ph/6lUX3c5/LUk//DPkMXLlsAPPxad7TQH8ehPQ+3R36WjnC\nBzwx6z3g3vib87W7bZbHWt8qOa32QzK9Es9G8gun78yrx7qJG3DEexBaZXgC\nMT612Q7lZRu9RH++vJBB4cXxlhHb6yEYVVFwlfDCIQX59D9IVKVd97hYrok/\nvSxdJGPx2porYuqfgQV01bSnRDYNaPFfD8HHl1Hf0xmb4arv3Rdg9xYwkuAO\nHXscEwzXi2LkaFkFU8Nhm5WowIyGLjkBhw/iMWkHcYzr+g8EuCDxB9Ru/C1N\n1L3q\r\n=Gf/W\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFoZfau0izve+GH3JTYCu8NROBmSAF4gdJsZZEeztuOVAiEAyLcQYONXP+PU0EgFAntoD+wlpbn6xVc3ehAdC8nOnPs="}]},"maintainers":[{"name":"hauntedthemes","email":"contact@hauntedthemes.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ghost-search_1.0.1_1548667022943_0.5080959092285204"},"_hasShrinkwrap":false},"1.1.0":{"name":"ghost-search","version":"1.1.0","description":"A simple but powerful search library for Ghost Blogging Platform.","main":"dist/ghost-search.js","scripts":{"dev":"gulp"},"repository":{"type":"git","url":"git+https://github.com/HauntedThemes/ghost-search.git"},"keywords":["ghost","search"],"author":{"name":"Haunted Themes","email":"contact@hauntedthemes.com","url":"https://www.hauntedthemes.com"},"license":"MIT","bugs":{"url":"https://github.com/HauntedThemes/ghost-search/issues"},"homepage":"https://github.com/HauntedThemes/ghost-search","dependencies":{"fuzzysort":"^1.1.4"},"devDependencies":{"@babel/core":"^7.2.2","@babel/preset-env":"^7.7.1","gulp":"^4.0.2","gulp-babel":"^8.0.0","gulp-concat":"^2.6.1","gulp-header-comment":"^0.6.1","gulp-minify":"^3.1.0","gulp-resolve-dependencies":"^3.0.1","gulp-sourcemaps":"^2.6.5"},"gitHead":"60d6ef22889b54633f2eeab2a88a83fe5e880adf","_id":"ghost-search@1.1.0","_nodeVersion":"10.17.0","_npmVersion":"6.11.3","dist":{"integrity":"sha512-nLmGFhY7iob5IIgo99l2dNZPvoDWqS0tSH9RnR5njs1gTnew5hI6pTpGSNbDNC/r/n0P2QfmFcSm8LmmdcnUWA==","shasum":"5f105297629425391ff5d4e5d4532efbbf61bef6","tarball":"https://registry.npmjs.org/ghost-search/-/ghost-search-1.1.0.tgz","fileCount":8,"unpackedSize":106126,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdzl9HCRA9TVsSAnZWagAAtr4P/14lA8wcrhNrgHXiDYe3\nfyAno8qx3uvFqZQh6cuGaJ6EkQFt409U1f06l339trfzveAk+N/zIermgI1q\nNBnGWD1DMZGYjfcFWrEPzfJtMTbCSYa9MdWwenDVDzPPsSl3a2vG1Lcc3XYr\nK8dgZe35HHdNNoIzU+g85/116QLCdNCS010pY0tfiRw8Q+AbItHj2W29WBjh\niLax8BXcNZLLIWfJ0vdgDZ5OgDtAC+0zME5pnvTftp47dsD/dXYuj9LtmYEh\n4OsTtAqtjkvNnauoXTRk8ru+2LPhTJ95VgK/EyzcPQ9r2Oyuq1MPBC48W6Jg\nO0v/X2mXHP2dGxd4aHFsax5np3/ADbRxqMoAnQ0b71QP9e7ekkQ6TGrmbNFN\nSJDuUIqqMbdlUulqGHJACtwIeX6pMUrAn1n6x6Krdzgan3E9XusKskr26f5p\nM/e1jA2HuQ/BBDHIavVgZn3Xnp8v5QdVVKY7CngK3xxgPyFzJ3UGr7XeGAA/\nXDITp9UR3+x/aGhuNXgh3RiJQbTOSMV0NdMi+YevFTomyaAWKRa8trm/Vu7X\nazHAV1lRaeszx3iAEx8dUWP5n8bAJLzZYVijQ5RHpjCcgHc5HIOSPEVeXqHB\n8J+BlDFgQ7y93gtpqn9lB6pkw0cJzj+VnJ51BvmQ/xoNNZtRNzE/iBIRoDG8\nJj7/\r\n=8Vki\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC9zl+KprD3Ne4ZSZfcn7X8pJTfha9TKCV4LqJbad0gKgIhANMxQPs747mqUs00+n5Cf7tQ1wfI++aldgiSLkrkXGjO"}]},"maintainers":[{"name":"hauntedthemes","email":"contact@hauntedthemes.com"}],"_npmUser":{"name":"hauntedthemes","email":"contact@hauntedthemes.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ghost-search_1.1.0_1573805894642_0.8847233554540253"},"_hasShrinkwrap":false}},"time":{"created":"2018-09-17T13:17:07.374Z","0.1.0":"2018-09-17T13:17:08.062Z","modified":"2022-05-03T17:54:18.233Z","0.1.1":"2018-11-29T11:32:11.246Z","1.0.0":"2019-01-21T13:06:28.189Z","1.0.1":"2019-01-28T09:17:03.087Z","1.1.0":"2019-11-15T08:18:14.748Z"},"maintainers":[{"name":"hauntedthemes","email":"contact@hauntedthemes.com"}],"description":"A simple but powerful search library for Ghost Blogging Platform.","homepage":"https://github.com/HauntedThemes/ghost-search","keywords":["ghost","search"],"repository":{"type":"git","url":"git+https://github.com/HauntedThemes/ghost-search.git"},"author":{"name":"Haunted Themes","email":"contact@hauntedthemes.com","url":"https://www.hauntedthemes.com"},"bugs":{"url":"https://github.com/HauntedThemes/ghost-search/issues"},"license":"MIT","readme":"[![Min Ghost Version](https://img.shields.io/badge/Min%20Ghost%20v.-%3E%3D%203.0.0-blue.svg)](https://github.com/TryGhost/Ghost)\r\n[![npm version](https://badge.fury.io/js/ghost-search.svg)](https://www.npmjs.com/package/ghost-search)\r\n\r\n# ghost-search\r\n\r\nA simple but powerful search library for [Ghost Blogging Platform](https://ghost.org/).\r\n\r\n## Setup\r\n\r\n### Step 1 - Setup Content API Client Library\r\n\r\nGet the [latest version](https://unpkg.com/@tryghost/content-api) of Ghost Content API Client Library from unpkg.com.\r\n\r\n```js\r\n<script src=\"https://unpkg.com/@tryghost/content-api@{version}/umd/content-api.min.js\"></script>\r\n```\r\n\r\nAdd the script before the `{{ghost_foot}}` tag. This will, most likely, be in `default.hbs`.\r\n\r\n### Step 2 - Setup ghost-search\r\n\r\nOpen your theme directory and navigate to `assets` subdirectory. \\\r\nCreate a directory called `js`, if there isn't already one in there, and add the minified version of `ghost-search` in it. \\\r\nOpen `default.hbs` that is located at the root of your theme. \\\r\nAt the bottom of this file you should see `{{ghost_foot}}`. \\\r\nAdd the following code above it (after the content-api script at Step 1) and save it:\r\n\r\n```\r\n<script type=\"text/javascript\" src=\"{{asset \"js/ghost-search.min.js\"}}\"></script>\r\n```\r\n\r\nAdd the following code, in a `.hbs` file, where you want to show the search input:\r\n\r\n```html\r\n<input id=\"ghost-search-field\">\r\n```\r\n\r\nAdd the following code, in a `.hbs` file, where you want to show the search results:\r\n\r\n```html\r\n<div id=\"ghost-search-results\"></div>\r\n```\r\n\r\nYou will need to initialize `ghost-search` to make the search functional. \\\r\nAdd the following js code after you included `ghost-search.min.js`:\r\n\r\n```javascript\r\n<script>\r\n    let ghostSearch = new GhostSearch({\r\n        key: '22444f78447824223cefc48062', // This is just a demo key. Replace the key with a real one. See Step 3.\r\n        url: 'https://demo.ghost.io', // This is just a demo host. Replace the demo url with a real one. See Step 3.\r\n    })\r\n</script>\r\n```\r\n\r\n### Step 3 - Setup a Custom integration\r\n\r\nGo in your Ghost's dashboard -> Integrations -> Add custom integration \\\r\nSet a name: Haunted Themes Search \\\r\nGet the Content API Key and replace the demo key with this one. [More details](https://ghost.org/docs/api/v3/content/#key). \\\r\nGet the admin domain. This will be different in some cases. [More details](https://ghost.org/docs/api/v3/content/#url).\r\n\r\n## Use ghost-search from CDN\r\n\r\n```html\r\n<script src=\"https://cdn.jsdelivr.net/npm/ghost-search@1.0.1/dist/ghost-search.min.js\"></script>\r\n```\r\n\r\n## npm\r\n\r\n```javascript\r\nnpm install ghost-search\r\n```\r\n\r\n## Live Examples\r\n\r\n[Set a basic search](https://www.hauntedthemes.com/ghost-search-our-first-open-source-library-for-ghost/#set-a-basic-search) \\\r\n[Display a message if there are no posts found](https://www.hauntedthemes.com/ghost-search-our-first-open-source-library-for-ghost/#display-a-message-if-there-are-no-posts-found) \\\r\n[Search only through tags](https://www.hauntedthemes.com/ghost-search-our-first-open-source-library-for-ghost/#search-only-through-tags) \\\r\n[Search posts from a custom collection](https://www.hauntedthemes.com/ghost-search-our-first-open-source-library-for-ghost/#search-posts-from-a-custom-collection) \\\r\n[Search posts that are published after 01 Jan 2018](https://www.hauntedthemes.com/ghost-search-our-first-open-source-library-for-ghost/#search-posts-that-are-published-after-01-jan-2018) \\\r\n[Search through the title and content of posts](https://www.hauntedthemes.com/ghost-search-our-first-open-source-library-for-ghost/#search-through-the-title-and-content-of-posts) \\\r\n[Get the results when a button is clicked](https://www.hauntedthemes.com/ghost-search-our-first-open-source-library-for-ghost/#get-the-results-when-a-button-is-clicked) \\\r\n[Get proper results when your Ghost is on a sub-path](https://www.hauntedthemes.com/ghost-search-our-first-open-source-library-for-ghost/#get-proper-results-when-your-ghost-is-on-a-sub-path) \\\r\n[Set multiple instances of ghost-search on the same page](https://www.hauntedthemes.com/ghost-search-our-first-open-source-library-for-ghost/#set-multiple-instances-of-ghost-search-on-the-same-page) \\\r\n[Add a loading icon when you have a lot of posts](https://www.hauntedthemes.com/ghost-search-our-first-open-source-library-for-ghost/#add-a-loading-icon-when-you-have-a-lot-of-posts) \\\r\n[Limit the results displayed](https://www.hauntedthemes.com/ghost-search-our-first-open-source-library-for-ghost/#limit-the-results-displayed)\r\n\r\n## Default Options\r\n\r\n```js\r\n{\r\n    host: '',\r\n    key: '',\r\n    version: 'v2',\r\n    input: '#ghost-search-field',\r\n    results: '#ghost-search-results',\r\n    button: '',\r\n    development: false,\r\n    defaultValue: '',\r\n    template: function(result) {\r\n        let url = [location.protocol, '//', location.host].join('');\r\n        return '<a href=\"' + url + '/' + result.slug + '/\">' + result.title + '</a>';  \r\n    },\r\n    trigger: 'focus',\r\n    options: {\r\n        keys: [\r\n            'title'\r\n        ],\r\n        limit: 100,\r\n        threshold: -3500,\r\n        allowTypo: false\r\n    },\r\n    api: {\r\n        resource: 'posts',\r\n        parameters: { \r\n            limit: 'all',\r\n            fields: ['title', 'slug'],\r\n            filter: '',\r\n            include: '',\r\n            order: '',\r\n            formats: '',\r\n        },\r\n    },\r\n    on: {\r\n        beforeDisplay: function(){},\r\n        afterDisplay: function(results){},\r\n        beforeFetch: function(){},\r\n        afterFetch: function(){}\r\n    }\r\n}\r\n```\r\n\r\n## Options\r\n\r\n### url\r\n\r\nThe url that needs to be set in order for Content API to properly authenticate. [More details](https://docs.ghost.org/api/content/#url).\r\n\r\n### key\r\n\r\nThe key that needs to be set in order for Content API to properly authenticate. [More details](https://docs.ghost.org/api/content/#key).\r\n\r\n### version\r\n\r\nThe version that needs to be set in order for Content API to properly authenticate. [More details](https://ghost.org/docs/api/v3/content/#path--version).\r\n\r\nDefault value: `'v3'`\r\n\r\n### input\r\n\r\nThe ID of the input field that will be transformed into search filter. \\\r\nYou can set your own id if you want like this:\r\n\r\n```html\r\n<input id=\"my-custom-input\">\r\n```\r\n\r\n```html\r\n<script type=\"text/javascript\">\r\n    let ghostSearch = new GhostSearch({\r\n        input: '#my-custom-input'\r\n    })\r\n</script>\r\n```\r\n\r\nDefault value: `'#ghost-search-field'`\r\n\r\n### results\r\n\r\nThe ID of the element that will be transformed into search results. \\\r\nYou can set your own id if you want like this:\r\n\r\n```html\r\n<div id=\"my-custom-results\"></div>\r\n```\r\n\r\n```html\r\n<script type=\"text/javascript\">\r\n    let ghostSearch = new GhostSearch({\r\n        results: '#my-custom-results'\r\n    })\r\n</script>\r\n```\r\n\r\nDefault value: `'#ghost-search-results'`\r\n\r\n### button\r\n\r\nThe ID of the element that will trigger the search results after it's clicked. \\\r\nBy default, the button parameter is empty because `ghost-search` displays the results when you write in the input. \\\r\nTo make this work you need to add the input and the button in a `form` element:\r\n\r\n```html\r\n<form>\r\n    <input id=\"my-custom-input\">\r\n    <input type=\"submit\" id=\"my-custom-button\">\r\n</form>\r\n<div id=\"my-custom-results\"></div>\r\n```\r\n\r\n```html\r\n<script type=\"text/javascript\">\r\n    let ghostSearch = new GhostSearch({\r\n        input: '#my-custom-input',\r\n        results: '#my-custom-results',\r\n        button: '#my-custom-button'\r\n    })\r\n</script>\r\n```\r\n\r\nDefault value: `''`\r\n\r\n### defaultValue\r\n\r\nA parameter that will set a default value for the input and performs the search.\r\n\r\n```html\r\n<script type=\"text/javascript\">\r\n    let ghostSearch = new GhostSearch({\r\n        defaultValue: 'ghost'\r\n    })\r\n</script>\r\n```\r\n\r\nDefault value: `''`\r\n\r\n### template\r\n\r\nThe template that will be used to render individual items in the search result. \\\r\nThe method has a parameter `result` that stores all the data that you can use inside the method.\r\n\r\n#### Examples:\r\n\r\nMake the results a list and wrap each result with `<li>`:\r\n\r\n```html\r\n<div id=\"my-custom-input\"></div>\r\n<ul id=\"my-custom-results\"></ul>\r\n```\r\n\r\n```html\r\n<script type=\"text/javascript\">\r\n    let ghostSearch = new GhostSearch({\r\n        input: '#my-custom-input',\r\n        results: '#my-custom-results',\r\n        template: function(result) {\r\n            let url = [location.protocol, '//', location.host].join('');\r\n            return '<li><a href=\"' + url + '/' + result.slug + '\">' + result.title + '</a></li>';  \r\n        }\r\n    })\r\n</script>\r\n```\r\n\r\nSet url with sub-path:\r\n\r\n```html\r\n<script type=\"text/javascript\">\r\n    let ghostSearch = new GhostSearch({\r\n        input: '#my-custom-input',\r\n        results: '#my-custom-results',\r\n        template: function(result) {\r\n            let url = [location.protocol, '//', location.host].join('') + '/sub-path/';\r\n            return '<a href=\"' + url + '/' + result.slug + '\">' + result.title + '</a>';  \r\n        }\r\n    })\r\n</script>\r\n```\r\n\r\nDefault value:\r\n\r\n```js\r\nfunction(result) {\r\n    let url = [location.protocol, '//', location.host].join('');\r\n    return '<a href=\"' + url + '/' + result.slug + '\">' + result.title + '</a>';  \r\n}\r\n```\r\n\r\n### trigger\r\n\r\nTells the script when to fetch the collection of data. The default value is `focus`, that means when a user clicks the input, all the data is fetched. \\\r\nYou can also use `load`. This will fetch the data when the page loads.\r\n\r\n`load` might **create a DDOS effect** because it loads all the data every time a page loads. Use carefully.\r\n\r\nDefault value: `'focus'`\r\n\r\n### options\r\n\r\n`ghost-search` is using `fuzzysort` as an algorithm for search. The `option` parameter supports all the options from [fuzzysort](https://github.com/farzher/fuzzysort#options).\r\nBy default, `ghost-search` is showing the first 10 results and searches only based on title.\r\n\r\nLet's try another example that will show the first 3 results and searches both title and the content of a collection:\r\n\r\n```html\r\n<script type=\"text/javascript\">\r\n    let ghostSearch = new GhostSearch({\r\n        options: {\r\n            keys: [\r\n                'title',\r\n                'plaintext'\r\n            ],\r\n            limit: 3,\r\n        },\r\n        api: {\r\n            resource: 'posts',\r\n            parameters: { \r\n                fields: ['title', 'slug', 'plaintext'],\r\n                formats: 'plaintext',\r\n            },\r\n        },\r\n    })\r\n</script>\r\n```\r\n\r\nDefault value:\r\n\r\n```js\r\n{\r\n    keys: [\r\n        'title'\r\n    ],\r\n    limit: 10,\r\n    threshold: -3500,\r\n    allowTypo: false\r\n}\r\n```\r\n\r\n### api\r\n\r\nThe api parameter is an object that supports most of the [resources](https://docs.ghost.org/api/content/#resources) and [parameters](https://docs.ghost.org/api/content/#parameters) by [Content API](https://docs.ghost.org/api/content/).\r\n\r\nResources: [posts](https://docs.ghost.org/api/content/#posts), [tags](https://docs.ghost.org/api/content/#tags), [authors](https://docs.ghost.org/api/content/#authors) \\\r\nParameters: [fields](https://docs.ghost.org/api/content/#fields), [filter](https://docs.ghost.org/api/content/#filter), [include](https://docs.ghost.org/api/content/#include), [order](https://docs.ghost.org/api/content/#order), [formats](https://docs.ghost.org/api/content/#formats), [limit](https://docs.ghost.org/api/content/#limit)\r\n\r\nExamples:\r\n\r\nSearch through tags:\r\n\r\n```html\r\n<script type=\"text/javascript\">\r\n    let ghostSearch = new GhostSearch({\r\n        options: {\r\n            keys: [\r\n                'name',\r\n            ],\r\n        },\r\n        api: {\r\n            resource: 'tags',\r\n            parameters: { \r\n                fields: ['name', 'slug'],\r\n            },\r\n        },\r\n        template: function(result) {\r\n            let url = [location.protocol, '//', location.host].join('') + '/tag';\r\n            return '<a href=\"' + url + '/' + result.slug + '/\">' + result.name + '</a>';  \r\n        },\r\n    })\r\n</script>\r\n```\r\n\r\nSearch through a custom collection:\r\n\r\nLet's say we have a `routes.yaml` like this:\r\n\r\n```yaml\r\nroutes:\r\n\r\ncollections:\r\n  /themes/:\r\n    permalink: /themes/{slug}/\r\n    filter: tag:themes\r\n    data: tag.themes\r\n  /:\r\n    permalink: /{slug}/\r\n    filter: tag:-themes\r\n    template:\r\n      - index\r\n\r\ntaxonomies:\r\n  tag: /tag/{slug}/\r\n  author: /author/{slug}/\r\n```\r\n\r\n`/themes/` is a collection that will show posts with tag `themes`. A post like this will have the url `example.com/themes/post-slug`.\r\n\r\nOur `ghost-search` will become:\r\n\r\n```js\r\nlet ghostSearch = new GhostSearch({\r\n    options: {\r\n        keys: [\r\n            'title',\r\n        ],\r\n    },\r\n    api: {\r\n        resource: 'posts',\r\n        parameters: { \r\n            fields: ['title', 'slug'],\r\n            filter: 'tags:[themes]',\r\n            include: 'tags'\r\n        },\r\n    },\r\n    template: function(result) {\r\n        let collection = 'themes';\r\n        let url = [location.protocol, '//', location.host].join('') + '/' + collection;\r\n        return '<a href=\"' + url + '/' + result.slug + '/\">' + result.title + '</a>';  \r\n    },\r\n})\r\n```\r\n\r\n### on\r\n\r\nThis parameter has 4 methods in it: `beforeDisplay`, `afterDisplay`, `beforeFetch`, `afterFetch`. \\\r\n`afterDisplay` and `afterFetch` have a parameter `results` that contains the results fetched. \\\r\nThey are useful to do things before results are visible to users.\r\n\r\nExample:\r\n\r\n```\r\nlet ghostSearch = new GhostSearch({\r\n    on: {\r\n        beforeFetch: function(){\r\n            // Create a div that has a spinning icon\r\n            console.log('Loading appears');\r\n        },\r\n        afterFetch: function(results){\r\n            // Remove the spinning icon\r\n            console.log('Loading disappears');\r\n        }\r\n    }\r\n})\r\n```\r\n\r\n## Contributing\r\n\r\nAll changes should be committed to `src/` files only.\r\n\r\n## Known Issues\r\n* DDOS effect when `trigger` is set to `load`.\r\nIf you have a lot of posts and set `trigger` to `load` you might get a DDOS effect because you are loading all the post everything a page loads. It would be better to just set `trigger` to `focus`.\r\n\r\n## Changelog\r\n\r\n### 1.0.1 - 28 Jan 2019\r\n* Editable limit parameter. [5](https://github.com/HauntedThemes/ghost-search/issues/5)\r\n\r\n### 1.0.0 - 21 Jan 2019\r\n* Public API (deprecated) will not work anymore. The library is accessing Content API.\r\n\r\n### 0.1.1 - 29 Nov 2018\r\n* Added `defaultValue` parameter.\r\n\r\n### 0.1.0 - 17 Sep 2018\r\n* Initial release\r\n\r\n## Thank You\r\nghost-search is using as a search algorithm [fuzzysort](https://github.com/farzher/fuzzysort). \\\r\nThank you [farzher](https://github.com/farzher/) for creating fuzzysort, a simple and usable search library.\r\n\r\n## Copyright & License\r\n\r\nCopyright (c) 2019 Haunted Themes - Released under the [MIT license](LICENSE). \\\r\n[Ghost is a trademark of The Ghost Foundation](https://ghost.org/)\r\n","readmeFilename":"README.md"}