Advertisement
Guest User

Untitled

a guest
May 17th, 2019
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.93 KB | None | 0 0
  1. the following is added in the bottom of default.hbs
  2.  
  3. <script src="{{asset "js/ghost-finder.js"}}"></script>
  4. <script>
  5. // Ghost search
  6. new GhostFinder({
  7. input: '.search-field',
  8. showResult: '.search-post',
  9. contentApiKey: window.contentApiKey,
  10. time_format: 'DD MMM YYYY',
  11. resultTemplate:`<div class="result-template post-feed">
  12. <p class="match-result">Matches result: ##resultCount</p>
  13. ##results
  14. </div>`,
  15. singleResultTemplate: `<article class="post-card">
  16. <a class="post-card-image-link" href="##url">
  17. <div class="post-card-image" style="background-image:##feature_image"></div></a>
  18. <div class="post-card-content">
  19. <a class="post-card-content-link" href="##url">
  20. <header class="post-card-header">
  21. <h2 class="post-card-title">##title</h2>
  22. </header>
  23. <div class="post-card-excerpt">
  24. <p>##excerpt</p>
  25. </div>
  26. </a>
  27. </div>
  28. </article>`
  29. }) </script>
  30.  
  31. in the header.hbs
  32.  
  33. <div class="search-section">
  34. <input class="form-control search-field" type="text" placeholder="Search Bar">
  35. </div>
  36. <div class="search-post"></div>
  37.  
  38. in code injection (via ghost admin) i have
  39. header
  40.  
  41. <script>
  42. var contentApiKey = "5698bd372c04dc918c99e3a960";
  43. </script>
  44.  
  45. i added the ghost-finder.js from https://github.com/electronthemes/ghost-finder/blob/master/dist/ghost-finder.js
  46.  
  47. error:
  48.  
  49. 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
  50. (anonymous) @ VM924:1
  51. dispatchXhrRequest @ ghost-finder.js?v=5dba5bfee8:3179
  52. xhrAdapter @ ghost-finder.js?v=5dba5bfee8:3014
  53. dispatchRequest @ ghost-finder.js?v=5dba5bfee8:3420
  54. Promise.then (async)
  55. request @ ghost-finder.js?v=5dba5bfee8:3492
  56. Axios.(anonymous function) @ ghost-finder.js?v=5dba5bfee8:3502
  57. wrap @ ghost-finder.js?v=5dba5bfee8:2356
  58. makeRequest @ ghost-finder.js?v=5dba5bfee8:3766
  59. browse @ ghost-finder.js?v=5dba5bfee8:3728
  60. _callee$ @ ghost-finder.js?v=5dba5bfee8:23226
  61. tryCatch @ ghost-finder.js?v=5dba5bfee8:152
  62. invoke @ ghost-finder.js?v=5dba5bfee8:378
  63. prototype.(anonymous function) @ ghost-finder.js?v=5dba5bfee8:204
  64. asyncGeneratorStep @ ghost-finder.js?v=5dba5bfee8:23165
  65. _next @ ghost-finder.js?v=5dba5bfee8:23167
  66. (anonymous) @ ghost-finder.js?v=5dba5bfee8:23167
  67. (anonymous) @ ghost-finder.js?v=5dba5bfee8:23167
  68. (anonymous) @ ghost-finder.js?v=5dba5bfee8:23343
  69. ghost-finder.js?v=5dba5bfee8:2721 Uncaught (in promise) Error: Request failed with status code 404
  70. at createError (ghost-finder.js?v=5dba5bfee8:2721)
  71. at settle (ghost-finder.js?v=5dba5bfee8:2738)
  72. at XMLHttpRequest.handleLoad (ghost-finder.js?v=5dba5bfee8:3078)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement