Total Pageviews

Sunday, 15 November 2026

让muse帮我搭建基于nextjs+notion的静态博客程序nobelium


 我以email id: brightmann@gmail.com登录了https://app.notion.com/ 。(登录地址:

 https://app.notion.com/login)。

以下是我跟muse的对话过程。

me:  can u build https://github.com/brightmann/nbl?

nbl is Nobelium — a Notion + Next.js blog (fork of craigary/nobelium, Next 14). I cloned it and checked the setup. One thing I need from you before I can build it:

It reads posts from a Notion database (not a page), and it expects specific columns: title, slug, status (Published/Draft), type (Post/Page), date, and tags. The database also needs to be shared to the web so the Cloudflare build can fetch it. Your jb and rw databases have different columns, so they won't work as-is.

Which database should it use?

me:  Create a fresh Nobelium database for me.

 On it — I'm duplicating the official Nobelium template into your Notion workspace now, then sharing it to the web so the build can read it. Once it reports back the new database ID, I'll wire it into the build and deploy.

 

The Notion database is created and the build works. Here's where it stands:

Done:

  • Duplicated the official Nobelium template into your Notion ("mann bright's Space"), shared to web. ID c2463c580eea8312b4b001cfabe1711b, columns title/slug/date/summary/tags/status/type — the exact Nobelium schema.
  • Local build succeeds (43 pages, feed + sitemap generated). Fixed three things along the way: Notion's API 403s the default User-Agent (now sends a browser one), public fetches return a double-wrapped recordMap (unwrapped), and ISR + the server-side RSS feed don't work in a static export (removed revalidate, feed now builds to feed.xml).
  • Committed as 01f11b2 (static export, ready for Workers).

To push and deploy, I need one thing from you:

A GitHub PAT for brightmann/nbl (Contents scope) to push the commit.

me: my github pat here...

 Pushed — commit 01f11b2 is now on GitHub main. The PAT is used and the remote is restored, so you can revoke it.

What shipped: the Nobelium template duplicated into your Notion (28 demo posts), converted to a static export. Commits 01f11b2 + 065fb6f are on GitHub main. The build fetches your public Notion database at build time, so a new post needs a rebuild to appear — same as your other static sites.

Two reminders: the site still shows the template's 28 demo posts and Craigary's branding (title CRAIGARY, link nobelium.vercel.app) — replace the posts in Notion and edit blog.config.js when you're ready. 

 me: can u host the app on brightmann.github.io/nbl?

 

Push-to-live works through a GitHub Actions workflow, exactly like jb — that's why jb's primary surface is Pages now.

The trade-offs:

  • The URL becomes brightmann.github.io/nbl (a subpath) instead of the clean nbl.luckypoem.workers.dev subdomain. The Workers site you already have would stay live unless you want it retired.
  • You'd need to enable Pages in the repo settings (Source: GitHub Actions) and add NOTION_PAGE_ID as a repo secret — both one-time, your step. The build itself needs a basePath of /nbl so assets and links work under the subpath.
  • One caveat: the Notion fetch runs on GitHub's shared runners, so it could hit the same rate-limit jb did — but jb proves the Pages path works, and I can add the same retry if it trips.

Want me to set it up on Pages?

me:  what's the NOTION_PAGE_ID of nbl?

c2463c580eea8312b4b001cfabe1711b,That's the ID of the Nobelium database duplicated into your Notion — the public URL is https://adaptable-porter-f0a.notion.site/c2463c580eea8312b4b001cfabe1711b. It's the value to put in as the NOTION_PAGE_ID repo secret for the Pages workflow.

Nobelium reads posts from a Notion database (the table with the title/slug/date/status/type/tags columns) — the code checks that the page is a database and returns nothing if it isn't. A regular page ID won't work.

The ID I gave you (c2463c580eea8312b4b001cfabe1711b) is that database's ID — the Nobelium template table duplicated into your Notion. That's the one to put in as the NOTION_PAGE_ID secret.

me:  since it's the database's ID, why it's called NOTION_PAGE_ID?

 

Because in Notion, a database is a page. A database is just a special kind of page — a collection_view_page, a page whose content is a table. So the database has a page ID like any other page, and that's what the variable holds.

Nobelium names it NOTION_PAGE_ID because it just takes "the ID of the Notion page" — it happens to require that page to be a database (the code checks the type is a collection view), but the ID itself is a page ID.

me:  ok,set it up on github Pages.

 

The Pages setup is ready and tested locally — basePath /nbl works (all links, fonts, and assets prefixed correctly), and the workflow is committed. But the push was rejected: the PAT you pasted doesn't have the workflow scope, and GitHub requires it to create/update a workflow file.

Can you paste a new nbl PAT with Contents + Workflows scope? That's the only thing blocking the push.

Two notes: I saw you deleted pnpm-lock.yaml — I left that as-is and changed the workflow to plain pnpm install (no --frozen-lockfile) so the Pages build works without it. And once the workflow is pushed, you'll still need to add the NOTION_PAGE_ID secret (c2463c580eea8312b4b001cfabe1711b) and set Pages source to GitHub Actions in the repo settings before the site goes live.

me:  i put back pnpm-lock.yaml, so pls do corresponding changes.

 

Done. Two things:

  1. The lockfile you restored was the old format (lockfileVersion 6.0) — pnpm 12 refuses it for --frozen-lockfile with ERR_PNPM_BROKEN_LOCKFILE. So the corresponding change was to regenerate it to v9.0 (plain pnpm install does that). I committed the regenerated lockfile, and the workflow now uses --frozen-lockfile again. Build verified with it — works.

  2. The push is still blocked on the same thing: the PAT needs the workflow scope to push the workflow file. The commit (a734712, on top of your lockfile restore) is ready locally. Paste a PAT with Contents + Workflows and I'll push it.

    me:   where to add NOTION_PAGE_ID as a repo secret?

     

    Go to https://github.com/brightmann/nbl/settings/secrets/actions (or: repo → Settings → Secrets and variables → Actions → New repository secret).

  3. Name: NOTION_PAGE_ID
  4. Secret: c2463c580eea8312b4b001cfabe1711b

Click Add secret. That's the one the Pages workflow reads at build time.

me: my github pat here...

me: i already add NOTION_PAGE_ID as a repo secret.

 Quick status on the Pages setup: the secret is in place, and the workflow has been failing on setup errors one after another — I've fixed each as it surfaced (pinned a pnpm version, dropped a stale .npmrc line, then pinned pnpm 12 to match the regenerated lockfile). The latest run with those fixes is underway now. I'll check it and confirm once brightmann.github.io/nbl is live.

 

finished. https://brightmann.github.io/nbl is live: homepage, a post page, /page/2, and /feed.xml all return 200.

It took five rounds of workflow fixes to get the first green run (pnpm version pin, dropping a stale .npmrc line, pnpm 12 to match the lockfile, Node 20 for the canvas prebuilt, and a Notion 429 retry like jb's). From now on, pushing to main redeploys it on its own — same as jb.

The site still shows Craigary's branding and demo posts, so replacing those with yours is the next step whenever you're ready.

me:  why my post https://brightmann.github.io/nbl/fh is not "the newest first"? pls correct posts order.

 

Fixed and verified live. The cause: Nobelium's default is sortByDate: false, so the listing was using the raw Notion database order instead of date order — that's why your newest post sat on the last page. I set it to true in blog.config.js, and now the homepage is newest-first: 战马 first, then 稀奇古怪的中国经济, then the older demo posts.

One note: the date shows as Nov 14 on the post page because the site reads dates in Shanghai time, so 2026-11-15 00:00 there renders as Nov 14 in US time. The order itself is correct.

me:  i found all posts of the app author are place fillers. how to delete them from https://app.notion.com/p/c2463c580eea8312b4b001cfabe1711b?v=99563c580eea829da14b8871dece2ef1

 

I checked the database — there are 30 rows: your 2 posts (fh 战马, ce 稀奇古怪的中国经济) and 28 of Craigary's demo rows (25 posts + 3 pages: about, playground, experiment).

To delete them by yourself in Notion: open that link, in the table, hover over the left edge of a row to tick its checkbox, select some demo row (or tick all, then untick fh and ce), then click Delete in the bar at the top. They go to Trash, so it's recoverable for 30 days.

One small note: about and experiment are still in the Notion database, but they're Pages, not Posts, so they don't show in the blog listing — only about appears as the nav link.

me:  can u build github.com/brightmann/nbl on vercel.com/new? u can use my github a/c brightmann@gmail.com to login vercel.com

 Pushed the Vercel prep (pnpm 12 + Node 20 pinned, /feed redirect) and started the Vercel import in the browser — it'll sign in with your GitHub account, import brightmann/nbl, set the Notion ID, and deploy. I'll report the URL once it finishes.

me: where will u set the Notion page ID?

In Vercel itself — on the import screen at vercel.com/new there's an Environment Variables section, where I'm setting NOTION_PAGE_ID for all environments (Production, Preview, Development). After the import it lives in the project dashboard under Settings → Environment Variables, so you can see or change it there anytime.

Update on Vercel: the first deploy failed because Vercel discontinued Node 20. I fixed it — removed the unused canvas package (it was the only thing blocking Node 26) and set Node 26. That broke the GitHub Pages workflow briefly (pnpm version conflict), fixed that too, and Pages is green again with just your 2 posts.

Now checking whether Vercel picked up the new push and built it — I'll send you the URL once it's ready.

 

Vercel is live: https://nbl-five.vercel.app — I verified it just now. Homepage shows only your 2 posts (战马, 稀奇古怪的中国经济), /fh loads, and /feed.xml works. Pushes to main auto-deploy there now, same as GitHub Pages.

So nbl is now on 2 platforms: GitHub Pages (primary), Vercel.

me: ur fixes on the vercel.com are pushed to my repo?

Yes, all of them — they're commits on your repo's main branch, and Vercel deployed from those pushes:

  • d26488e — Prepare for Vercel deploy (pnpm 12, Node 20, /feed redirect)
  • 0b40a42 — Drop canvas, use Node 26 for Vercel
  • 6636694 — Fix Pages workflow: drop pnpm version pin

Nothing was changed only on Vercel's side. The only things set in the Vercel dashboard itself are the project (nbl) and the NOTION_PAGE_ID env var — those live in Vercel, not in the repo, which is normal.

得到的博客地址: 

 brightmann.github.io/nbl

 https://nbl-five.vercel.app

项目地址:

 https://github.com/craigary/nobelium

 https://github.com/brightmann/nbl

No comments:

Post a Comment