Skip to content

Commit 393c61b

Browse files
feat: remove index rendering, let consumers do that as appropriate for
their static site renderer
1 parent 1b89161 commit 393c61b

File tree

2 files changed

+1
-17
lines changed

2 files changed

+1
-17
lines changed

src/SyncConfig.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,6 @@ export interface SyncConfig {
2020
*/
2121
outDir: string;
2222

23-
/**
24-
* The path where the sync will store an index of rendered pages and their properties.
25-
* The index is
26-
*/
27-
indexPath: string;
28-
2923
/**
3024
* Configuration options for any database encountered while traversing the block graph.
3125
* This allows you to customize the way the CMS imports the database and its pages.
@@ -69,7 +63,7 @@ export interface DatabaseConfigRenderTable extends DatabaseConfigBase {
6963

7064
entries: {
7165
/**
72-
* Controls whether to emit database entries to the index (see SyncConfig.indexPath)
66+
* Controls whether to emit database entries to the index of rendered pages/entries
7367
*/
7468
emitToIndex: boolean;
7569
};

src/sync.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { promises as fs } from "fs";
2-
31
import { Client } from "@notionhq/client";
42

53
import { BlockRenderer } from "./BlockRenderer";
@@ -62,14 +60,6 @@ export async function sync(notionApiToken: string, config: SyncConfig) {
6260
await deferredRenderer.process();
6361

6462
const rendered = deferredRenderer.getRenderedPages();
65-
await fs.writeFile(
66-
config.indexPath,
67-
`export const index = ${JSON.stringify(
68-
rendered,
69-
null,
70-
2
71-
)};`
72-
);
7363

7464
return rendered;
7565
}

0 commit comments

Comments
 (0)