Testing all Blocks Here

The second of many thrilling descriptions

Hello everyone, this is my blogpost "Hello world!"

It's written in Notion and pre-rendered on this page using Next.js getInitialProps. It also uses Incremental Static Generation with theĀ validateĀ option so the content updates when the source is edited.

šŸŖ„ How does it work?

  • Write blogpost in Notion
  • Use Notions public API
  • Profit!
  • Now I'm just writing placeholder content to try out the different blocks available. How about aĀ link,Ā bold text,strikethrough text,Ā italic text andĀ code? Colored text?

    šŸŽ‰ Source code

    Get the source code at my github repo:Ā https://github.com/samuelkraft/notion-blog-nextjs

    šŸ¤” What about a fancy table block?

    āŒ Unsupported block (child_database)

    Copy of Test table

    The notion API only supports a couple of basic text-like blocks as specified inĀ their documentation

    Supported blocks:

    Heading 1

    Heading 2

    Heading 3

    Paragraph

  • bulleted list 1
  • bulleted list 2
  • bulleted list 3
  • numbered list 1
  • numbered list 2
  • numbered list 3
  • What is this?

    It's the children of a toggle!

    Colored Block


    A simple quote block
    javascript
    export const getDatabase = async (databaseId) => {
    const response = await notion.databases.query({
    database_id: databaseId,
    });
    return response.results;
    };
    javascript
    // Code Block with Caption
    Hereā€™s a nice little caption here!
    šŸ“Ž PIVOT.jpeg

    Sub Page

    External Image

    Notion-hosted image

    Hereā€™s an embedded video with a caption! Rendered with react-player

    This is a local file!

    Customizing

    To edit a block change theĀ renderBlockĀ function inĀ [id].js

    āœŒļø

    ā† Go home