-
Notifications
You must be signed in to change notification settings - Fork 198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Notion content source implementation #393
Conversation
|
Very excited to look into this once I'm back from my vacation towards the end of the month. As this is a fairly big change to Contentlayer, it would probably be useful to exchange some DMs via Discord. Feel free to DM me via the Contentlayer Discord channel. :) |
The You can find the documentation in the description of this PR. |
Keep going @kerwanp ! That's a super work |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
👋🏻 I think I've been trying out the alpha of notion as a content source via contentlayer. This is my first time using notion. One blocker for me at the moment is that i cant seem to be able to add any page i want from notion into contentlayer as it looks like i can only source databases? |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
is it possible to add |
🚧 This is a work in progress
Supports for Notion
This pull request implements Notion as a content source.
Related issues
Context
Notion is becoming a standard in the industry and almost 100% of our customers use it daily. As a Web Agency we want to provide an easy way for our customers to update the content of their website without relying on us.
We started a while ago the development of NotionCMS a NodeJS library to use Notion as if it was a CMS including a renderer to transform Notion Page Content into HTML.
Unfortunately, there are a lot of problems with the path we decided to took with this tool. This is why we are looking for an alternative and the best solution we found is to implement Notion to Contentlayer.
Documentation
https://www.contentlayer.dev/docs/sources/notion
Rendering content
Notion does not use markdown, it looks like but unfortunately for us it is not.
Instead, it returns objects called blocks of different type (paragraph, heading, etc). More information here.
This is why I created @notion-render/client a library that transform thoses blocks into HTML. The renderer can be extended to override current blocks and add custom ones to handle Notion Plugins.
Roadmap
Example
You can find an example in
examples/node-script-notion
.