How I built Notion to Site, and how I'd build it today

By

Updated

Tagged: Business

How I built Notion to Site in 2022, why it stayed an internal test, what the code taught me, and how AI agents could help turn it into a business today.

In December 2022 I built an internal project called Notion to Site. The pitch fit in a single line:

Write in Notion, publish on your site.

I built it for myself and only ever used it for internal testing. I never launched it or published the code. Recently I found the repository again in my old projects folder, and reading through it showed me how much I’d put together. It already had a working Notion renderer, static page generation, nested pages, columns, tables, images, videos, colors, and dark mode.

Still, it was nowhere near a real product. There were no user accounts, no billing, no OAuth flow, no dashboard, and no automated way to deploy a customer’s site. The rendering engine worked, and everything around it was missing.

Why I built it

It started a few days earlier with another project called solocreator.io, my first attempt at what later turned into the Solopreneur Masterclass and eventually Internet Business Lab (enrollment for the October 2026 cohort is closed).

I wanted to use Notion as the editor for that site. Notion is great for writing, but I didn’t want my website to look like a shared Notion page. I wanted my own domain, my own design, and plain static HTML I could host anywhere, so I started building that layer myself.

The first commit to Solo Creator was on December 7, 2022. Over the next two days I added support for more Notion blocks, subpages, readable URLs, nested pages, and page layouts. Then on December 13 I reused that engine in a separate private project called Notion to Site, and even put together a test landing page to work on the positioning, though everything stayed internal.

The landing page promised a few broad things:

  • highly customizable
  • developer friendly
  • incredibly flexible
  • based on a modern and solid tech stack

Looking back, I’d built the tech without deciding what the business was supposed to be. I hadn’t figured out if it was a library, a hosted service, a starter kit, or a website builder for people who didn’t want to touch code, and each of those is a completely different product.

How it worked

The stack was Astro, React, Tailwind CSS, and the official Notion JavaScript client. This was back on the Astro 1 beta, so I was betting on Astro pretty early. Its static-first model fit what I wanted: fetch the content at build time, turn it into HTML, and host the files anywhere. That bet held up. I still use Astro today (now on Astro 7), and it became the A in the AHA Stack I created with Astro, HTMX, and Alpine.js.

The main architectural decision was fetching everything from Notion at build time. Inside Astro’s getStaticPaths(), the code connected to the Notion API, found the child pages, and generated a static route for each one:

export async function getStaticPaths() {
  const notion = new Client({
    auth: import.meta.env.NOTION_API_KEY,
  })

  const page = await notion.pages.retrieve({
    page_id: import.meta.env.NOTION_PAGE_ID,
  })

  const pages = await getAllSubpagesOfPage(page, notion)

  return pages.map((page) => {
    const slug = slugify(getTitle(page))

    return {
      params: { slug },
      props: { page, notion, slug },
    }
  })
}

Because all of that ran during the build, the Notion API token stayed in the build environment and visitors just got plain HTML. I still like that setup. The published site was fast, cheap to host, and didn’t depend on Notion responding every time someone opened a page.

The tradeoff was that editing a page in Notion didn’t change the live site until you triggered a rebuild. There were no Notion webhooks, background jobs, or deploy queues, so publishing was still a manual step.

I wrote my own Notion block renderer

The project included notion-to-md, and the earliest commits imported it, but I ended up rendering the Notion blocks myself. The renderer was a big React component with a sub-component for each supported block, routed through a central switch statement:

switch (block.type) {
  case 'paragraph':
    return <Paragraph block={block} />
  case 'heading_1':
    return <Heading1 block={block} />
  case 'table':
    return <Table block={block} />
  case 'toggle':
    return <Toggle block={block} />
  case 'image':
    return <Image block={block} />
  case 'video':
    return <Video block={block} />
  default:
    return <UnknownBlock block={block} />
}

It handled paragraphs, three heading levels, callouts, quotes, to-do items, bulleted lists, tables, toggles, dividers, images, videos, child pages, and columns. Inside it sat a second renderer for rich text, covering bold, italic, strikethrough, underline, inline code, links, text colors, and background colors. I even mapped Notion’s colors to separate palettes for light and dark mode.

One detail I’m still glad I added was the fallback for unknown blocks. Whenever Notion returned a block type my code didn’t recognize, instead of quietly skipping it, the renderer printed a red warning right on the page with the unknown block type. You wouldn’t want that on a production site, of course, but it made building and debugging the renderer a lot easier.

Notion’s tree made routing interesting

In Notion, a page can live directly inside another page, or it can sit inside a column block inside another page. Those two cases return different parent objects from the API.

To handle that, I wrote a getPageOfBlock() function that walked up the block tree until it found the containing page. From there, getPagePath() kept climbing through parent pages to build the full URL. That gave me paths based on the Notion hierarchy rather than a flat list of page IDs.

The original Solo Creator codebase supported routes three levels deep. When I copied the engine over to Notion to Site, I only kept the top-level dynamic route. The path calculation code survived, while the deeper route files didn’t. That’s the kind of half-finished edge you find in a prototype, where the pieces exist but aren’t wired all the way through.

Slugs created another problem

Since I didn’t want URLs full of Notion page IDs, I generated slugs straight from page titles. The slug helper lowercased the title, stripped accents and unsupported characters, turned spaces into hyphens, and collapsed repeated hyphens.

That produced clean URLs, along with two bugs I’d already written down in the old README:

  • changing a page title changed its URL
  • two pages with the same title produced the same slug

To handle this in a real product, you need a stable ID behind the readable URL. Store the Notion page ID as the permanent key, keep track of every previous slug for that page, and generate redirects automatically whenever a page gets renamed.

The limitations were already visible

Right next to the code for images uploaded to Notion, I left a comment in the old repo:

// TODO store local? link expires in 1 hour. see how to do

The Notion API returned an S3 URL for each uploaded image, and that URL expired after one hour. If you dropped that link straight into static HTML, the image stopped loading an hour later. Any production publishing service has to download those images during the build and host its own permanent copies.

Other limits were already showing:

  • block requests weren’t paginated
  • nested children were only fetched for a few block types
  • list nesting wasn’t handled properly
  • code blocks were missing
  • some icons were skipped because the extra API calls slowed builds down
  • a large site triggered a lot of API requests on every build
  • Notion layout details like resized columns and images weren’t available through the API

The Notion API still returns block children as a paginated list, expects integrations to fetch nested children recursively, and applies rate limits. If you want this to run reliably in production, you need a proper sync engine instead of direct API calls scattered through page components.

Why it did not become a business

Writing code for one of your own sites and building a product other people pay for are very different jobs. Once I looked at what it would take to open this up, I realized I’d become the anello debole, the weak link, sitting between the Notion API and every customer’s website. An API change meant adapting my code. A failed sync stopped a customer’s site from updating, and a missing image became my problem instead of Notion’s. Customers would be right to expect me to fix it, since they’d be paying me to keep that integration working. At the time, I wasn’t ready to take on that responsibility.

Turning the prototype into a SaaS also meant building everything the repo didn’t have yet:

  • Notion OAuth for multiple customers
  • account management
  • a database for sites, domains, tokens, and settings
  • a reliable sync and build pipeline
  • previews and publishing controls
  • custom domains and SSL
  • themes and customization
  • image storage
  • billing
  • support and documentation

None of that existed in the codebase. The test landing page had a waiting list form, and I never opened it up as a public product.

I’d also started with the most open-ended part of the project, trying to render as much of Notion as possible. That creates a maintenance surface that never stops growing, because every new block, nesting combination, API change, and visual tweak becomes something you have to support forever. Meanwhile, my landing page never even explained who the tool was for or what problem it solved better than the alternatives. Turning Notion into a website is a neat feature, sure, but by itself it wasn’t a clear reason for anyone to pay me. The project stopped there and never went past internal testing.

How I would restart it today

Four years later, I can see myself taking another shot at this. The big difference now is having my agentic shipping “platform” in place: the tools, skills, workflows, and review process I use to take an idea all the way to tested, deployed software with agents. Sitting between Notion and my customers is still a real responsibility for a solo founder, though having agents around makes building and running that bridge much more manageable.

I wouldn’t dig up the old repository and try to update its dependencies. I’d build a new working version first and put it in front of people to see how they react. Landing pages and conversations only tell you so much, while watching someone use a real product gives you honest feedback fast. Running paid traffic is another good way to put that product in front of strangers and see whether they complete the first useful action.

The first version should focus on one kind of customer:

A technical creator or small agency that wants to write in Notion, publish a fast branded website on its own domain, and never maintain the publishing plumbing.

That customer still cares about customization, without wanting to build OAuth, sync jobs, image caching, deploy hooks, redirects, and previews by hand. All of that plumbing is the product, with the Notion renderer sitting inside it as one piece.

Keep the launch scope narrow. Skip the theme marketplace and don’t try to support every possible Notion workspace right away. Two solid themes and a clear list of supported blocks are plenty. Whenever a page includes an unsupported block, the app needs to warn the user before publishing so content never disappears silently.

The core flow for version one looks like this:

  1. Sign in and connect Notion using a public OAuth integration.
  2. Choose a root page.
  3. Preview the generated website.
  4. Pick a theme and change a small set of design tokens.
  5. Connect a domain.
  6. Publish.

Notion’s platform also gives you better building blocks now, including public OAuth connections for multi-workspace products and webhooks for page changes. Every edit can trigger a queued sync that fetches the changed page, normalizes its blocks into an internal format, copies new media to permanent storage, and rebuilds only what changed.

Keeping Notion page IDs as the internal identity means URLs can change without breaking old links. Separating Notion’s raw API responses from the renderer helps just as much. Feeding the renderer your own stable page format makes API upgrades, tests, imports from other sources, and new frontends much easier to handle.

What AI agents change

Back in 2022, every piece of the long tail landed on me. Even with libraries and examples to pull from, I still had to handle every block renderer, fixture, test, migration, UI state, build failure, support reply, and documentation page myself.

AI agents change the economics of a small product like this. They won’t make a weak idea good, find customers for me, or remove the need to support what I ship. I’d still sit between Notion and my customers, except agents can continuously test that connection, watch for failures, look into what changed, and prepare a fix. That lets one person operate much closer to a small team.

Agents could help build the renderer

Notion blocks fit bounded agent work well. You can give an agent a single block type along with the official API shape, a set of fixtures, visual rules, and the tests it has to pass. Different agents can tackle code blocks, nested lists, bookmarks, or synced blocks in parallel without stepping on each other.

The fixture library and visual regression suite are what hold everything together. Without tests watching the output, you’d only produce fragile, unsupported code faster, whereas a strict test suite lets agents extend the renderer without touching shared contracts or breaking existing sites.

An agent could configure each new site

Setting up a new site usually feels like a cost, though an agent can turn it into an advantage. Right after someone picks a root page, an onboarding agent can inspect the Notion page tree and put together a starting proposal:

  • the navigation structure
  • page titles and descriptions
  • redirects for duplicate or unsafe slugs
  • a theme based on the customer’s existing brand
  • missing images or broken links
  • unsupported blocks that need attention

The customer reviews the proposal before anything goes live. Working inside a small, predictable system like this is much more reliable than asking a model to generate an arbitrary website from a prompt.

Agents could turn customization into conversation

The old test landing page promised a highly customizable, developer-friendly product. Normally that leads to a bloated settings panel or forces people to edit code.

An agent opens up a nicer interface. A customer could ask:

Make the headings smaller, use the logo’s blue for links, and add the About page to the top navigation.

Instead of editing production code directly, the agent translates that request into validated theme tokens and navigation settings inside a constrained config, shows a preview, and waits for approval. You keep the flexibility without turning every customer site into a custom fork.

Agents could help operate the business

Publishing products fail in repetitive ways: a Notion token expires, a block response changes, an image fails to download, a build breaks, or a domain is misconfigured.

An operations agent can catch those failures, pull the relevant logs, pinpoint the likely cause, and prepare the next action. It can also answer support questions from the live state of the customer’s site rather than sending a generic reply. I’d keep human approval around anything destructive or customer-facing, while letting the agent take care of most of the investigation work.

The new moat would not be AI

Anyone can call a model, so the real value sits in the system around it:

  • a reliable Notion sync engine
  • a well-tested block renderer
  • fast websites
  • safe customization
  • stable URLs
  • permanent media
  • previews and rollbacks
  • excellent onboarding

AI agents make it possible for a solo founder to build and operate all of those pieces, while people pay for the end result: writing in Notion and getting a website they’re proud to put on their own domain.

Would I build it again?

Yes. I’d build a lean version, put it online, and see how people react, letting real usage decide what to improve, remove, or build next. Agents would handle a lot of the ongoing work on new blocks, edge-case tests, site setup, build checks, and customer support.

None of the 2022 code went to waste, because it proved the basic idea worked and showed the exact point where a technical project has to become a product. Turning it into a business is still the hard part, and agents make it faster and cheaper to run the experiment and keep improving it if people stick around.

Want me to talk about your product? You can sponsor this site.

Related posts about business: