Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- the following is added in the bottom of default.hbs
- <script src="{{asset "js/ghost-finder.js"}}"></script>
- <script>
- // Ghost search
- new GhostFinder({
- input: '.search-field',
- showResult: '.search-post',
- contentApiKey: window.contentApiKey,
- time_format: 'DD MMM YYYY',
- resultTemplate:`<div class="result-template post-feed">
- <p class="match-result">Matches result: ##resultCount</p>
- ##results
- </div>`,
- singleResultTemplate: `<article class="post-card">
- <a class="post-card-image-link" href="##url">
- <div class="post-card-image" style="background-image:##feature_image"></div></a>
- <div class="post-card-content">
- <a class="post-card-content-link" href="##url">
- <header class="post-card-header">
- <h2 class="post-card-title">##title</h2>
- </header>
- <div class="post-card-excerpt">
- <p>##excerpt</p>
- </div>
- </a>
- </div>
- </article>`
- }) </script>
- in the header.hbs
- <div class="search-section">
- <input class="form-control search-field" type="text" placeholder="Search Bar">
- </div>
- <div class="search-post"></div>
- in code injection (via ghost admin) i have
- header
- <script>
- var contentApiKey = "5698bd372c04dc918c99e3a960";
- </script>
- i added the ghost-finder.js from https://github.com/electronthemes/ghost-finder/blob/master/dist/ghost-finder.js
- error:
- VM924:1 GET https://staging.starkandwayne.com/ghost/api/v2/content/posts/?key=5698bd372c04dc918c99e3a960&limit=all&fields=title%2Curl%2Cslug%2Chtml%2Cfeature_image%2Cpublished_at%2Cprimary_author%2Cprimary_tag&include=tags%2Cauthors 404
- (anonymous) @ VM924:1
- dispatchXhrRequest @ ghost-finder.js?v=5dba5bfee8:3179
- xhrAdapter @ ghost-finder.js?v=5dba5bfee8:3014
- dispatchRequest @ ghost-finder.js?v=5dba5bfee8:3420
- Promise.then (async)
- request @ ghost-finder.js?v=5dba5bfee8:3492
- Axios.(anonymous function) @ ghost-finder.js?v=5dba5bfee8:3502
- wrap @ ghost-finder.js?v=5dba5bfee8:2356
- makeRequest @ ghost-finder.js?v=5dba5bfee8:3766
- browse @ ghost-finder.js?v=5dba5bfee8:3728
- _callee$ @ ghost-finder.js?v=5dba5bfee8:23226
- tryCatch @ ghost-finder.js?v=5dba5bfee8:152
- invoke @ ghost-finder.js?v=5dba5bfee8:378
- prototype.(anonymous function) @ ghost-finder.js?v=5dba5bfee8:204
- asyncGeneratorStep @ ghost-finder.js?v=5dba5bfee8:23165
- _next @ ghost-finder.js?v=5dba5bfee8:23167
- (anonymous) @ ghost-finder.js?v=5dba5bfee8:23167
- (anonymous) @ ghost-finder.js?v=5dba5bfee8:23167
- (anonymous) @ ghost-finder.js?v=5dba5bfee8:23343
- ghost-finder.js?v=5dba5bfee8:2721 Uncaught (in promise) Error: Request failed with status code 404
- at createError (ghost-finder.js?v=5dba5bfee8:2721)
- at settle (ghost-finder.js?v=5dba5bfee8:2738)
- at XMLHttpRequest.handleLoad (ghost-finder.js?v=5dba5bfee8:3078)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement