Turn your Notion pages into a website with instant page loads and SEO optimization.
Let's assume you have this Notion page and you want to turn it into a website, then follow these steps:
- Open Notion page.
- Share > toggle Share to web.
- Turn this:
https://www.notion.so/nerkarso/Example-8a3e3cf883454b9ca073b125e88715b4
- Into this:
http://localhost:3000/Example-8a3e3cf883454b9ca073b125e88715b4
Create a .env.local
file and add the following:
NEXT_PUBLIC_FAVICON="/img/favicon.png"
NEXT_PUBLIC_OG_IMAGE="/img/og-image.png"
NEXT_PUBLIC_PLACEHOLDER_IMAGE="/img/placeholder.png"
NEXT_PUBLIC_REVALIDATE_TOKEN="gnotion"
NEXT_PUBLIC_SITE_TITLE="Docs"
NEXT_PUBLIC_SITE_URL="https://gnotion.vercel.app"
NEXT_PUBLIC_THEME_FONT_FAMILY="Proxima Nova"
NEXT_PUBLIC_THEME_PRIMARY_COLOR="#3399ff"
http://localhost:3000/api/og-image?subtitle=Docs&title=Web%20Development&image=https://gnotion.vercel.app/img/placeholder.png
Next.js allows you to create or update static pages after you’ve built your site. Starting with v12.2.0, Next.js supports On-Demand Incremental Static Regeneration to manually purge the Next.js cache for a specific page.
curl http://localhost:3000/api/revalidate?token=xxxxxx&path=/path/to
token
: replace with yourNEXT_PUBLIC_REVALIDATE_TOKEN
.path
: the exact path that you want revalidated.