You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+31Lines changed: 31 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,6 +29,7 @@ Tired of uploading a markdown file to your GitHub for every new blog post? Havin
29
29
- ⌨️ Title and their properties in plain text accessible via the front matter
30
30
- 🔮 All raw properties accessible via GraphQL
31
31
- 🍻 Support for `remark` and `mdx`
32
+
- 👀 Near real-time preview in development mode
32
33
33
34
# Quick Start
34
35
@@ -213,9 +214,38 @@ interface PluginConfig {
213
214
databases?:string[];
214
215
/** UUID of pages to be sourced, default to be `[]` i.e. none */
215
216
pages?:string[];
217
+
/** the number of api calls per seconds allowed for preview, 0 to disable preview default to be 2.5 */
218
+
previewCallRate?:number;
219
+
/** TTL settings for each API call types, default to cache database metadata and blocks */
220
+
previewTTL?: {
221
+
/** the number of seconds in which a database metadata will be cached, default to be 0 i.e. permanent */
222
+
databaseMeta?:number;
223
+
/** the number of seconds in which a metadata of a database's entries will be cached, default to be 0.5 */
224
+
databaseEntries?:number;
225
+
/** the number of seconds in which a page metadata will be cached, default to be 0.5 */
226
+
pageMeta?:number;
227
+
/** the number of seconds in which a page content will be cached, default to be 0 i.e. permanent */
228
+
pageContent?:number;
229
+
};
216
230
}
217
231
```
218
232
233
+
# Preview Mode
234
+
235
+
This plugin ships with a preview mode by default and it is enabled.
236
+
Start your development server and type on your Notion page to see the content get updated on the Gatsby website.
237
+
238
+
Under the hood, this plugin automatically pulls the page metadata from Notion regularly and checks for any updates using the `last_edited_time` property.
239
+
When a change is detected, this plugin will reload the content automatically.
240
+
241
+
**NOTE** To adjust the frequency of update, you can specify the maximum allowed number of API calls.
242
+
The higher the more frequently it checks for updates.
243
+
The actual frequency will be computed automatically according to your needs but be mindful of current limits for Notion API which is 3 requests per second at time of publishing.
244
+
245
+
**NOTE** Unlike other integrations with preview, such as `gatsby-source-sanity`, this plugin can't sync any content from your Notion document that wasn't saved.
246
+
Notion has autosaving, but it is delayed so you might not see an immediate change in preview.
247
+
Don't worry though, because it’s only a matter of time before you see the change.
248
+
219
249
# Known Limitations
220
250
221
251
As this plugin relies on the the official Notion API which is still in beta, we share the same limitations as the API.
@@ -260,6 +290,7 @@ You just need to embed them using the normal markdown syntax as part of your par
260
290
261
291
3. What can I do if I don't want to permanently delete a post but just hide it for awhile?
262
292
You can create a page property (for example, a publish double checkbox) and use this information in your page creation process.
293
+
If you're in the development mode with preview enabled, you should be able to see the removal in near real-time.
0 commit comments