-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(scully): support icon, cover, and more customization for Page Pr…
…operties - Post Icon is now supported - Post Cover is now supported - More customization via NotionDomRouterPluginOptions BREAKING CHANGE: - `NotionPluginOptions` -> `NotionDomPluginOptions`
- Loading branch information
Chau Tran
authored and
Chau Tran
committed
Oct 20, 2021
1 parent
37116e7
commit 2b9e1ac
Showing
4 changed files
with
112 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,55 @@ | ||
import type { NotionBlocksHtmlParserOptions } from '@notion-stuff/blocks-html-parser'; | ||
import { PostResult, PropertyValue } from '@notion-stuff/v4-types'; | ||
import type { RouteConfig } from '@scullyio/scully'; | ||
|
||
export interface NotionPluginOptions { | ||
|
||
export interface NotionDomRouterPluginOptions extends RouteConfig { | ||
/** | ||
* @requires string Notion DatabaseID | ||
*/ | ||
databaseId: string; | ||
|
||
/** | ||
* Notion API Key. This should be provided via NOTION_API_KEY environment variable instead | ||
*/ | ||
notionApiKey?: string; | ||
|
||
/** | ||
* A custom function that will process the {PostResult} from Notion. You take over the Frontmatter with this function | ||
*/ | ||
postResultProcessor?<TObject = Record<string, unknown>>(post: PostResult, options: NotionDomRouterPluginOptions, propertyValueParser: (propertyValue: PropertyValue) => any): TObject; | ||
|
||
/** | ||
* A custom function that will resolve the `published` flag that Scully needs. | ||
*/ | ||
isPublished?<TObject = Record<string, unknown>>(frontmatter: TObject): boolean; | ||
|
||
/** | ||
* Default icon for your post | ||
*/ | ||
defaultPostIcon?: string; | ||
|
||
/** | ||
* The key that you use as your "Slug" in your Notion table. | ||
* @default "slug" (requires you to have a "Slug" property in your table) | ||
*/ | ||
slugKey?: string; | ||
|
||
/** | ||
* The base path of the route when setup in Scully config | ||
* @example | ||
* { | ||
* "/basePath/:slug": { | ||
* basePath: "/basePath" // needs to match /basePath | ||
* } | ||
* } | ||
* | ||
* @default "/blog" | ||
*/ | ||
basePath?: string; | ||
titleSuffix?: string; | ||
} | ||
|
||
export interface NotionDomPluginOptions { | ||
notionBlocksHtmlParserOptions?: NotionBlocksHtmlParserOptions; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters