Skip to content

Commit 72b0ad4

Browse files
author
GodoFredo
committed
Using ghost api version 2 for searches
1 parent ad2088a commit 72b0ad4

30 files changed

+129
-50
lines changed

.gitignore

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# Logs
66
logs
77
*.log
8+
*.ini
89

910
# Runtime data
1011
pids
@@ -474,6 +475,4 @@ __pycache__/
474475

475476
.sass-lint.yml
476477
.cache-loader
477-
*.map
478-
*.js.map
479-
.src
478+
yarn-error.log

README.md

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
Hi. I created this theme for ghost especially for you.
99
It is available for free so you can use on your site. It is strictly forbidden to use it for commercial use. If you have any suggestions to improve the theme, you can send me a tweet [@GodoFredoNinja](https://goo.gl/y3aivK)
1010

11-
## 🙏 Please, help me with a small donation [here](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=Y7UB5Q8GVN3HN&source=url) or [PayPal](https://www.paypal.me/godofredoninja). It'll help motivate me to update the theme with many improvements
11+
## 🙏 Please, help me with a small donation [here](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=4H53Q4RTPSFQW&source=url) or [PayPal](https://www.paypal.me/godofredoninja). It'll help motivate me to update the theme with many improvements
1212

13-
[![donate](./donate.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=Y7UB5Q8GVN3HN&source=url)
13+
[![donate](./donate.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=4H53Q4RTPSFQW&source=url)
1414

1515
![mapache theme for ghost](./screenshot.jpg)
1616

@@ -70,6 +70,7 @@ You can see mapache in action on my Page [Demo](https://goo.gl/V7moIY)
7070
- [4. Instagram](#4-instagram)
7171
- [5. Comments](#5-comments)
7272
- [6. Search](#6-search)
73+
- [Setup a Custom integration](#setup-a-custom-integration)
7374
- [Theme Translation](#theme-translation)
7475
- [AMP](#amp)
7576
- [Home Page](#home-page)
@@ -133,6 +134,22 @@ Mapache supports Disqus comments and Facebook comments as well as comment counti
133134

134135
The default search engine will only search the titles of the post
135136

137+
#### Setup a Custom integration
138+
139+
1. Go in your Ghost's dashboard -> Integrations -> Add custom integration
140+
2. Set a name: GodoFredo Themes Search
141+
3. Get the Content API Key and replace the demo key with this one
142+
4. Get the admin domain. This will be different in some cases
143+
144+
```html
145+
<script>
146+
var searchSettings = {
147+
key: 'ADD_YOUR_API_KEY',
148+
host: 'https://demo.ghost.io',
149+
};
150+
</script>
151+
```
152+
136153
The search engine that includes Mapache is very powerful, supports almost all languages and you can customize to your liking.
137154

138155
Read more about the search engine [Read More](https://github.com/HauntedThemes/ghost-search)
@@ -195,14 +212,16 @@ var facebookLocaleComments = 'en_US';
195212
196213
/* 06. Search Settings */
197214
var searchSettings = {
215+
key: 'ADD_YOUR_API_KEY',
216+
host: 'https://demo.ghost.io',
217+
/* This is optional */
198218
options: {
199219
keys: [
200220
'title',
201221
],
202222
limit: 10,
203-
threshold: -3500,
204-
allowTypo: false,
205223
},
224+
/* This is optional to perform filtering of the ghost api */
206225
api: {
207226
resource: 'posts',
208227
parameters: {

amp.hbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
{{amp_ghost_head}}
1212

1313
{{!-- Google Fonst --}}
14-
<link href="https://fonts.googleapis.com/css?family=Merriweather:400,700|Source+Sans+Pro:400,600" rel="stylesheet" />
14+
<link href="https://fonts.googleapis.com/css?family=Merriweather:400,700|Source+Sans+Pro:400,600,700" rel="stylesheet" />
1515

1616
{{!-- Style Custom --}}
17-
<style amp-custom>.u-bgColor{background-color:#00a034}{{> "amp/amp-styles"}}.article-image img{object-fit: cover;object-position: top}</style>
17+
<style amp-custom>.u-bgColor{background-color:#00A034}{{> "amp/amp-styles"}}</style>
1818

1919
{{!-- The AMP boilerplate --}}
2020
<style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style><noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript>

assets/scripts/main.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/scripts/pagination.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/scripts/prismjs.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/scripts/search.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/styles/main.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

default.hbs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
<meta name="HandheldFriendly" content="True" />
1111
<meta name="viewport" content="width=device-width, initial-scale=1">
1212
{{!-- Styles --}}
13-
{{!-- <link rel="stylesheet" type="text/css" href="{{asset "styles/main.css"}}"/> --}}
13+
<link rel="stylesheet" type="text/css" href="{{asset "styles/main.css"}}"/>
1414
{{!-- All Styles Compress --}}
15-
<style>{{> "styles"}}</style>
15+
{{!-- <style>{{> "styles"}}</style> --}}
1616
{{!-- Font Roboto 400 --}}
1717
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
1818
{{!-- Ghost outputs important style and meta data with this tag --}}
@@ -55,6 +55,8 @@
5555

5656
{{!-- The main JavaScript --}}
5757
<script src="{{asset "scripts/main.js"}}" defer></script>
58+
{{!-- Content API --}}
59+
<script src="https://unpkg.com/@tryghost/[email protected]/umd/content-api.min.js" defer></script>
5860
<script src="{{asset "scripts/search.js"}}" defer></script>
5961

6062
{{#if pagination.pages}}

documentation/ghost-settings.jpg

7.56 KB
Loading

0 commit comments

Comments
 (0)