@tryghost/algolia-netlify 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -7
- package/package.json +4 -5
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
### Set up Algolia
|
|
8
8
|
|
|
9
|
-
First step is to
|
|
9
|
+
First step is to grab the API keys and Application ID from Algolia. For the setup we need both, the "Search-Only API Key" as well as the "Admin API Key".
|
|
10
10
|
|
|
11
11
|
The Admin API Key can either be the general one, or can be created just for this specific search index.
|
|
12
12
|
|
|
@@ -31,6 +31,7 @@ The Ghost Algolia tooling uses [Ghost Webhooks](https://ghost.org/docs/api/webho
|
|
|
31
31
|
- Algolia Application ID
|
|
32
32
|
- The Algolia Admin API key or and API key with the permissions as described above
|
|
33
33
|
- The name of the index you want to use
|
|
34
|
+
- Set the `NETLIFY_KEY` to be used with the target URL
|
|
34
35
|
|
|
35
36
|
### Set up Ghost Webhooks
|
|
36
37
|
|
|
@@ -39,22 +40,22 @@ Ghost webhooks will initiate posts to be indexed to Algolia. This can be a new e
|
|
|
39
40
|
1. `post.published`
|
|
40
41
|
- Name: Post published
|
|
41
42
|
- Event: Post published
|
|
42
|
-
- Target URL: the endpoint of the post-published function, found on Netlify's admin panel (https://YOUR-SITE-ID.netlify.com/.netlify/functions/post-published)
|
|
43
|
+
- Target URL: the endpoint of the post-published function, found on Netlify's admin panel plus the `NETLIFY_KEY` as a query parameter as defined in the configuration data above (https://YOUR-SITE-ID.netlify.com/.netlify/functions/post-published?key=NETLIFY_KEY)
|
|
43
44
|
|
|
44
45
|
2. `post.published.edited`
|
|
45
46
|
- Name: Post updated
|
|
46
47
|
- Event: Published post updated
|
|
47
|
-
- Target URL: the endpoint of the post-published function, found on Netlify's admin panel (https://YOUR-SITE-ID.netlify.com/.netlify/functions/post-published)
|
|
48
|
+
- Target URL: the endpoint of the post-published function, found on Netlify's admin panel plus the `NETLIFY_KEY` as a query parameter as defined in the configuration data above (https://YOUR-SITE-ID.netlify.com/.netlify/functions/post-published?key=NETLIFY_KEY)
|
|
48
49
|
|
|
49
50
|
3. `post.unpublished`
|
|
50
51
|
- Name: Post unpublished
|
|
51
52
|
- Event: Post unpublished
|
|
52
|
-
- Target URL: the endpoint of the post-published function, found on Netlify's admin panel (https://YOUR-SITE-ID.netlify.com/.netlify/functions/post-unpublished)
|
|
53
|
+
- Target URL: the endpoint of the post-published function, found on Netlify's admin panel plus the `NETLIFY_KEY` as a query parameter as defined in the configuration data above (https://YOUR-SITE-ID.netlify.com/.netlify/functions/post-unpublished?key=NETLIFY_KEY)
|
|
53
54
|
|
|
54
|
-
4. `post.
|
|
55
|
+
4. `post.deleted`
|
|
55
56
|
- Name: Post deleted
|
|
56
57
|
- Event: Post deleted
|
|
57
|
-
- Target URL: the endpoint of the post-published function, found on Netlify's admin panel (https://YOUR-SITE-ID.netlify.com/.netlify/functions/post-unpublished)
|
|
58
|
+
- Target URL: the endpoint of the post-published function, found on Netlify's admin panel plus the `NETLIFY_KEY` as a query parameter as defined in the configuration data above (https://YOUR-SITE-ID.netlify.com/.netlify/functions/post-unpublished?key=NETLIFY_KEY)
|
|
58
59
|
|
|
59
60
|
These webhooks will trigger an index on every **future change of posts**.
|
|
60
61
|
|
|
@@ -86,4 +87,4 @@ you will create a server on `localhost:9000` where your functions will be expose
|
|
|
86
87
|
|
|
87
88
|
# Copyright & License
|
|
88
89
|
|
|
89
|
-
Copyright (c) 2013-
|
|
90
|
+
Copyright (c) 2013-2023 Ghost Foundation - Released under the [MIT license](LICENSE).
|
package/package.json
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tryghost/algolia-netlify",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"repository": "https://github.com/TryGhost/algolia/tree/master/packages/algolia-netlify",
|
|
5
5
|
"author": "Ghost Foundation",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"main": "index.js",
|
|
8
8
|
"scripts": {
|
|
9
|
-
"dev": "yarn
|
|
9
|
+
"dev": "yarn build && netlify dev",
|
|
10
10
|
"test": "NODE_ENV=testing mocha './test/**/*.test.js'",
|
|
11
11
|
"lint": "eslint . --ext .js --cache",
|
|
12
12
|
"posttest": "yarn lint",
|
|
13
|
-
"
|
|
14
|
-
"start": "NODE_ENV=production netlify functions:build --functions build/functions --src functions"
|
|
13
|
+
"build": "NODE_ENV=production netlify functions:build --functions build/functions --src functions"
|
|
15
14
|
},
|
|
16
15
|
"files": [
|
|
17
16
|
"index.js",
|
|
@@ -47,5 +46,5 @@
|
|
|
47
46
|
"@tryghost/algolia-fragmenter": "^0.2.5",
|
|
48
47
|
"@tryghost/algolia-indexer": "^0.2.2"
|
|
49
48
|
},
|
|
50
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "dd0550948311a01580a86111e79f5ae89dc2a431"
|
|
51
50
|
}
|