Under CTC Notion > Blog > Projects
- In Notion click new on the table to add a new row
- Fill in the Page name, slug, Date, and Authors
- At the top of the content area add the content you want to show as a preview (keep this under 2 paragraphs)
- Add a divider block under your preview content (/div or hit '-' until it becomes a div)
- Add the rest of your content under the divider block
This is using the unofficial Notion API, but hopefully doesn't break entirely:
export NEXT_PUBLIC_NOTION_TOKEN = 5e755ea78755c533b9294b48b81cbe55f0fafc69dcc2b04ffddcd773cfc7493b850cfacd980b404c193ad916f76849286af8ad4b3ef3b1cde79c74b7acffd7829d956a6760076b269db72ced6749
export NEXT_PUBLIC_BLOG_INDEX_ID = 5139c44e-2e76-48bc-adbf-61e18e70a6c8
then yarn dev
- Install dependencies
yarn
- Expose
NEXT_PUBLIC_NOTION_TOKEN
andNEXT_PUBLIC_BLOG_INDEX_ID
in your environmentexport NEXT_PUBLIC_NOTION_TOKEN='<your-token>'
andexport NEXT_PUBLIC_BLOG_INDEX_ID='<your-blog-index-id>'
orset NEXT_PUBLIC_NOTION_TOKEN="<your-token>" && set NEXT_PUBLIC_BLOG_INDEX_ID="<your-blog-index-id>"
for Windows - Run next in development mode
yarn dev
- Build and run in production mode
yarn build && yarn start
IF THE NOTION API BREAKS, THIS IS HOW WE ACCESSED IT FROM BEFORE
To get your blog index value, open Notion and Navigate to the Notion page with the table you created above. While on this page you should be able to get the page id from either:
- the URL, if the URL of your page is https://www.notion.so/Blog-S5qv1QbUzM1wxm3H3SZRQkupi7XjXTul then your
NEXT_PUBLIC_BLOG_INDEX_ID
isS5qv1QbU-zM1w-xm3H-3SZR-Qkupi7XjXTul
- the
loadPageChunk
request, if you open your developer console and go to the network tab then reload the page you should see a request forloadPageChunk
and in the request payload you should see apageId
and that is yourNEXT_PUBLIC_BLOG_INDEX_ID
To get your Notion token, open Notion and look for the token_v2
cookie.