me: can u build https://github.com/brightmann/snbn?
It's Samuel Kraft's Notion blog template — Next 13.4, App Router, all content from a Notion database at build time. That fits a static export to Cloudflare Workers, so the plan is the usual: build it and put it live at snbn.luckypoem.workers.dev.
Two things I need first, which I don't have for this repo:
- A Notion integration token (
NOTION_TOKEN) and a database ID (NOTION_DATABASE_ID). The database just needs two columns: Title and Slug (plain text, so your Chinese titles get slugs likefhinstead of slugifying to empty). - Two small fixes I'll make while building: the template's slug reading is inconsistent between the homepage and the article pages, and its renderer has no video block — your YouTube embeds would render as nothing. I'll add that.
One thing to know: this template has no publish switch — every row in the database shows up on the homepage.
Want me to create the integration and the database for you, like I did for rw? You'd just sign into Notion once in the browser. Or paste an existing token + database ID if you already have ones to use.
me: Create the integration + database for me
Creating the integration and database in Notion now — it'll sign in as you, and if Notion asks for an email code I'll need you to relay it. I'll report back with the setup once it's done, then build the site.
Notion is set up and the build works. Quick status:
- Integration
snbn-blog+ database "snbn Blog Posts" (Title + Slug) are created and shared — I verified the token reads the database via the API. - Local build passes. I tested with a temporary post (heading + paragraph + YouTube video) — the homepage listed it, the article page rendered, and the video became a real embed. Test post deleted, database is empty again.
- Code fixes committed locally (commit 352e410): static export config, slug reading made consistent, video/embed renderer,
next/head→generateMetadata, plus a GitHub Actions workflow that builds and deploys on push. Caught one thing: this repo's default branch ismaster, notmain— the workflow is set tomaster.
To push it I need a fresh token for this repo — fine-grained PAT for brightmann/snbn with Contents + Workflows (the push includes the workflow file). Paste it and I'll push.
After that, the workflow needs three repo secrets to deploy: NOTION_TOKEN, NOTION_DATABASE_ID, and CLOUDFLARE_API_TOKEN. I'll add the first two for you once the push is in; the Cloudflare one is the same token you used for nbl — you can add it yourself, or paste it again and I'll add it.
me: where to add NOTION_TOKEN and NOTION_DATABASE_ID?
In the repo itself: brightmann/snbn → Settings → Secrets and variables → Actions → New repository secret. That's where the deploy workflow reads them from.
I'm adding the two for you right now in the browser — NOTION_TOKEN and NOTION_DATABASE_ID. The third one, CLOUDFLARE_API_TOKEN, is still yours to add there — same token you used for nbl.
Done — both secrets are in the repo now (NOTION_TOKEN and NOTION_DATABASE_ID, verified in the list).
What's left for the deploy to work:
- Push the code — still needs that fresh snbn PAT (Contents + Workflows) from you.
CLOUDFLARE_API_TOKEN— add it in the same place (Settings → Secrets and variables → Actions), same token as nbl's.
Once the push lands, the workflow builds and deploys on its own, and I'll verify the live site.
me: how did u generate NOTION_TOKEN and NOTION_DATABASE_ID?
I didn't generate them myself — Notion did. I just created the two things and took the values Notion issued:
- NOTION_TOKEN: I created a new integration named
snbn-blogat notion.so/my-integrations. When Notion creates an integration, it issues an "Internal Integration Secret" — a token starting withntn_. That's the token. It's only shown once at creation, which is why I had it put straight into the repo secret instead of passing it around. - NOTION_DATABASE_ID: I created a new database page, "snbn Blog Posts", in your workspace. Every Notion page gets a unique ID when it's created — the 32-character string in the page's URL. That's the database ID.
Then I gave the integration access to that database (on the integration's Content access page), so the token can actually read it.
me: the github pat here...
It's live: snbn.luckypoem.workers.dev — homepage 200, verified.
One hiccup on the way: the first deploy failed because the blog database is empty. Next's static export errors when generateStaticParams returns an empty list, so I added a placeholder entry that 404s — same trick as semantic. Rebuilt, pushed, workflow succeeded.
Two things to know:
- The blog is empty for now. Add a row in the "snbn Blog Posts" database (Title + Slug) and it'll show up — but a Notion edit alone doesn't rebuild the site. Re-run the deploy workflow from the Actions tab after adding a post, or ask me and I'll trigger it.
- You can revoke the PAT now, both pushes are done.
me: why post https://snbn.luckypoem.workers.dev/article/ce can't show full article as https://rw.luckypoem.workers.dev/blog/ce?
me: https://snbn.luckypoem.workers.dev/article/ce Still doesn't show full article. I visit it in my mobile phone's browser,same results.
The cause: Notion's API returns at most 100 blocks per call, and the template only fetched the first page. Your ce article has well over 100 blocks, so everything after block 100 was missing — 5,869 characters shown out of 93,195.
Fixed now: the code pages through all blocks (and database rows, same limit) until there are no more. Pushed, deployed, and verified live — /article/ce now shows the whole article, ending with the same sentence as rw's version. Hard-refresh the tab on your phone and it'll be there.
You can revoke the PAT now — this push was the last one I needed it for.
me: can u make https://snbn.luckypoem.workers.dev/ support pagination?
Done — pagination is live:
- 5 posts per page, newest first
/is page 1,/page/2is page 2, with the numbered pager: Previous | 1 | 2 | Next (hidden when there's only one page)/page/1sends you back home, and/page/3404s
Verified live just now: page 1 shows your 5 newest (nutrition, chinese-people, song-sound, life-advice, ce), page 2 has fh. Your four new posts pushed it to 6 total, so the pager is already showing.
me: can u also deploy it on github pages?
Done — it's live on GitHub Pages too:
Same site, same posts and pagination — homepage, /page/2, and /article/ce all verified 200, with the pager showing. The Workers site at snbn.luckypoem.workers.dev is unaffected; both deploy on every push now.
https://brightmann.github.io/snbn/
得到的博客地址:
https://snbn.luckypoem.workers.dev/
https://brightmann.github.io/snbn/
项目地址:
https://github.com/samuelkraft/notion-blog-nextjs
https://github.com/brightmann/snbn
在https://app.notion.com里面创建的帖子就是源帖。
-------------------------------
相关帖子:
让muse帮我搭建基于nextjs+notion的静态博客程序rw






