Total Pageviews

Tuesday, 24 November 2026

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

 我是用email id: brightmann@gmail.com+邮箱验证码登录了app.notion.com/login

以下是我跟muse的对话内容:

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

 

Yes — it's samuraikun's Notion-headless-CMS blog (Next 13, pages router, posts from a Notion database). I've got the code ready and committed locally; it compiles clean, and the build only stops at the Notion login, which doesn't exist yet.

What's done:

  • Static export, so it can run on Workers (no Vercel needed)
  • Pagination, 5 per page with the numbered pager, on both the homepage and /articles
  • Covers stripped from cards and article headers, like your other blogs — this also dodges the template's 1-hour Notion image expiry
  • isPublic checkbox is the publish switch — only checked rows go live
  • YouTube video posts render as real embeds (the template's renderer handles that already)
  • Deploy workflows ready for Workers + GitHub Pages, auto-deploy on every push

What it needs is a Notion database with 6 columns: name, author, slug, published date, isPublic checkbox, tags. Your snbn and nbtn databases have different columns, so this one needs its own. Want me to create it for you, like I did for those two?

me:  Yes, set up Notion for me.

 

Setting up Notion now — the browser is creating the snnb-blog integration and the snnb Blog Posts database, then putting the two values straight into the repo's secrets. I'll tell you when it's done.

While that runs, could you paste a token for the push? It needs to cover the snnb repo with Contents + Workflows (the push includes the workflow files). Same as the others — I'll use it once for the push and you can revoke it after.

 

Notion is done — the snnb-blog integration and the snnb Blog Posts database (all 6 columns) are created, and both values are already in the repo's secrets. I also ran the build with the real credentials and it passes, so the integration can read the database.

Just the token for the push left — paste a snnb token (Contents + Workflows) when you can, and I'll push, set up the Cloudflare side, and get it live.

me:  'set up the Cloudflare side', what to set up concretely?

 

Three things, all small:

  1. A Cloudflare API token — "Edit Cloudflare Workers" template, on the Luckypoem account. It goes into the repo as the secret CLOUDFLARE_API_TOKEN, so the workflow can deploy.
  2. The deploy itself — the workflow runs wrangler deploy, which creates the Worker snnb and publishes it at https://snnb.luckypoem.workers.dev. Nothing to configure on the dashboard; the wrangler.jsonc in the repo already says what to deploy.
  3. GitHub Pages source set to GitHub Actions — so the second workflow can publish https://brightmann.github.io/snnb/. That's GitHub, not Cloudflare, but it's part of getting it live.

No Workers Builds project needed — GitHub Actions does the deploying here, same as nbtn and snbn.

I can do all of it in the browser once your token for the push arrives, including creating the Cloudflare token. Or if you'd rather create the token yourself, paste it here and I'll put it in the repo secret.

me: my github pat here...

 

Pushed. One hiccup I caught and fixed already: in the Workers workflow the token line had lost its indent, so GitHub rejected the whole file before running anything. Fixed and pushed again.

The Cloudflare setup is still running in the browser — token, repo secret, Pages source. Once that's done I'll check both deploys and verify the site live.

me:  no need of notion database id or notion token?

 

they're needed — the build fetches your posts from Notion, so both workflows need NOTION_KEY and NOTION_DATABASE_ID as repo secrets. But they're already set: the browser put them in earlier tonight.

Proof they work: both runs that just finished got through the build step fine and only failed on the Cloudflare side — the Workers one at wrangler deploy (no Cloudflare token yet) and the Pages one at Setup Pages (source not switched yet). That's exactly what the browser task is finishing now. Once it's done I'll re-run both and they should go green.

can u   create the token yourself in your own browser? (dashboard → API Tokens → "Edit Cloudflare Workers" template, Luckypoem account) and paste it here. Then I'll set the secret and Pages source.

 me: i already added CLOUDFLARE_API_TOKEN as repo secret.

 

Pages is live — https://brightmann.github.io/snnb/ returns 200. (Still samuraikun's branding, yours to change later.)

Workers failed on the token: it's on the right account (Luckypoem), but it's missing the User → User Details → Read permission — wrangler needs it for the /memberships check. Same thing that happened with nbtn last week.

Fix is a one-minute dashboard edit, in your own browser (mine still can't get past Cloudflare's verification check there): open the token at dash.cloudflare.com/profile/api-tokens, add User → User Details → Read (and make sure Workers Scripts → Edit is checked), save. Editing keeps the same token value, so the repo secret stays valid.

Tell me when it's saved and I'll re-trigger the deploy.

me: added.

 

Workers is live now — https://snnb.luckypoem.workers.dev returns 200. Your token fix worked.

Pages is still stuck on a weird one: the deploy step keeps saying it found 0 artifacts, even though the upload step succeeded and the artifact is right there (891KB, confirmed via the API). It failed the same way twice. I added a 30-second wait between upload and deploy in the Pages workflow and pushed it — the new run is going now. I'll check it and confirm once it's green.

Both green now — the 30-second wait fixed Pages.

The listing is empty because the Notion database has 0 posts yet — that's expected. To post: add a row in "snnb Blog Posts" (name, slug, published date, isPublic checked, tags), write the body on the row's page, and paste YouTube as a video block, not an embed. A Notion edit alone doesn't rebuild — push or re-run a workflow and it'll go live on both.

One thing left for later: the site still shows samuraikun's name and links. Say the word when you want to personalize it.

me:  Can u make https://snnb.luckypoem.workers.dev support pagination?

 

It's already there — 5 posts per page, with real /page/2 routes on the homepage and /articles, plus the numbered pager. I just checked the live site.

The reason you don't see it: the pager only shows when there's more than one page, and the Notion database still has 0 posts, so there's nothing to paginate yet. /page/2 correctly 404s right now.

Have you added posts to the "snnb Blog Posts" database since last night? If you did, they won't appear until a rebuild — a Notion edit alone doesn't rebuild the site.

me:  No posts yet, I'll add some first.

 Got it. Add 6 or more and the pager will show up on its own — just tell me once they're in and I'll trigger the rebuild so they go live.

 Quick heads-up on the smns thumbnail bot: its check ran just now but stopped after the first step — a security notice is blocking it from reading the checkout, and it needs your go-ahead to continue inspecting posts and generating thumbnails. Nothing was changed. Want me to let it proceed?

me:  "It's already there" means pagination is by default?

 

No — the template had no pagination at all. Its homepage just listed every post on one page.

I added it last night while building the site (commit 3c6a508): lib/pagination.ts, components/Pager.tsx, plus the /page/[page] and /articles/page/[page] routes — 5 per page, numbered pager. So when I said "it's already there," I meant it's in the build I already shipped, not that it came with the template.

me:  can u make the site on pc also look like that? One post per row.

 

Done — one post per row on PC now, same as your phone. Both workflows green and I verified live: the 2-column grid is gone from both sites, cards are full-width, all three posts still there in the same order.

You can revoke the snnb token I used for the pushes now.

得到的博客地址: 

 https://brightmann.github.io/snnb/

 https://snnb.luckypoem.workers.dev

项目地址:

 https://github.com/samuraikun/notion-headless-cms-nextjs-blog

 https://github.com/brightmann/snnb

 

 

 

Monday, 23 November 2026

ipv64.net提供的免费二级域名,支持动态解析、自定义ns记录


ipv64是一家德国免费动态解析服务,有免费的二级域名,支持动态解析,支持各种常见记录,自定义ns记录.
每个账号可以免费开通3个域名。 

网址:https://ipv64.net/

ipv64注册简单,只需验证邮箱,无需手机号、信用卡。登录密码是一串随机字符,会在激活邮件里同时发来。

免费后缀有19种之多。

进入顶部的DynDNS-DynDNS Domains,右侧添加域名。 

    ipv64.net
    ipv64.de
    api64.de
    dns64.de
    dyndns64.de
    dynipv6.de
    eth64.de
    home64.de
    iot64.de
    lan64.de
    nas64.de
    root64.de
    route64.de
    srv64.de
    tcp64.de
    udp64.de
    vpn64.de
    wan64.de

支持A、AAAA、TXT、MX、NS、SRV、CNAME、TLSA、CAA记录。

更新方式
更新方式有三种,有优先级。按优先级排序是:
    直接设置记录
    通过访问域名url更新
    通过访问账户url更新

可以通过路由器等设备访问, 链接自动更新为本机ip。

地理从来没有退出经济史

 

现代人谈经济,喜欢谈制度、资本、科技、教育,也喜欢谈产业政策、货币政策、人工智能。地理仿佛成了中学课本上的东西,地图看看就算了。

其实地理从来没有退出经济史。

美国为什么富,当然不能只归功于地理。自由民主、产权保护、资本市场、大学体系、移民社会,这些都是核心因素。但若把美国放到一块没有两洋保护、没有大片温带平原、没有密西西比河水系、没有五大湖、没有漫长海岸线的土地上,它还会不会发展成今天这个样子,就很难说。

制度决定人能不能把财富创造出来,地理决定创造财富时,要不要先多付一大笔成本。

美国的优势就在于,很多成本天然很低。

中部农业区规模巨大,内河航运成本低,东西两岸都有港口;北边加拿大,南边墨西哥,长期都不是足以威胁美国本土安全的强敌。美国可以把大量资源花在市场、工业、科技和资本扩张上,而不是天天担心陆上边疆。

冷战时期,这种差别就很明显。

苏联也不小,也有资源,也有核武器,也拉了一群东欧小国组成华约和经互会。纸面看,阵势并不差。

最后还是搞不过美国。

原因当然首先是制度问题。计划经济缺乏价格信号,资源配置效率低,创新动力不足。但地理也在默默加重成本。苏联面积巨大,却意味着距离巨大;气候寒冷,意味着道路、建筑、能源、农业成本都高;大量人口和工业离主要海洋市场很远,运输代价长期存在。

地图大,不等于经济腹地大。

加拿大也是如此。

加拿大国土面积惊人,但真正的人口、产业和商业活动,高度集中在南部,尤其靠美国边境的一条狭长地带。为什么?因为南边暖一点,更重要的是,南边就是美国。

加拿大真正值钱的地理资产,不是北极圈里那一大片颜色,而是旁边那个三亿多人口、收入极高、基础设施完整、产业链深度连接的美国市场。

这也就是加拿大今天若把“减少对美依赖”变成一种民族主义工程,容易出问题的地方。

贸易多元化当然没错。任何国家都不希望七成以上出口压在一个市场。

但多元化和舍近求远不是一回事。

现在世界经济的大趋势,并不是重新回到九十年代那种“哪里便宜就去哪里”的全球化,而是近岸化、友岸化、供应链安全和区域化。大家都在想办法把供应链缩短,把关键产业搬近,把政治风险降下来。

加拿大若在这个时候为了证明“我们不需要美国”,反而努力把更多贸易搬到欧洲、印度、亚洲,本质上是在逆着地理走。

货物不会因为民族尊严而缩短航程。

港口不会因为政治口号而取消运费。

汽车零部件、能源、木材、农产品,也不会因为政府提出“经济主权”,就突然变得适合跨越半个地球销售。

中国过去几十年的崛起,其实也说明同一道理。

中国当然有制度改革、人口红利、外资、教育扩张等原因,但真正爆发最快的地方在哪里?长三角、珠三角、沿海城市、长江流域。

不是青藏高原,也不是内蒙古深处。

因为这些地区人口密集、交通方便、港口众多,可以直接接入世界市场。

地理不是命运,但它不断给经济开价。

好的制度,可以把地理优势放大;差的制度,可以把好地理浪费掉。技术进步可以降低地理成本,却很难把它彻底消灭。

所以看一个国家长期有没有“戏”,不能只看国土多大、资源多少,也不能只看今天GDP是多少。

还要看它离国际市场多远,人口是否集中,运输是否便宜,气候是否适合,周边有没有可以合作的大经济体。

加拿大最大的幸运,就是美国在旁边。

如果把这种幸运当成一种羞辱,再用民族主义包装成“摆脱依赖”,最后可能会发现:政治可以重写讲话稿,地理却不会配合。

市场每天都在投票。

Sunday, 22 November 2026

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

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

 

nbtn is a fresh Next.js 12 blog starter with Notion added — basically create-next-app plus @notionhq/client, one commit, named blog_app. It also has a .env file committed in the repo.

One thing, though: the content failed an execution-risk check when I pulled it, so I can't install or build it as-is — processing it could run code from the repo. Do you want me to go ahead with it anyway?

 

nbtn builds — with two small fixes: the homepage was server-side rendered, so I changed it to static props for export, and images are now unoptimized. Dependencies installed, and a test build compiles fine — it only fails at the Notion call, because the .env in the repo holds just 2-character placeholders, no real key or database.

So it needs a real Notion setup: an integration key (NOTION_KEY) and a database (NOTION_DATABASE) whose rows have a Name title and a cover image. Same kind of setup as snbn, just simpler — no token_v2 needed here.

Want me to create a fresh integration + database for it, or point it at one of your existing databases?

me:  what's the difference between NOTION_TOKEN and NOTION_KEY?

 

No real difference — they're two names for the same kind of value: a Notion integration's secret token, passed to @notionhq/client as the auth token.

Each template just picked its own name:

  • nbtn reads NOTION_KEY
  • snbn and rw read NOTION_TOKEN
  • nnbb reads NOTION_API_INTEGRATION_SECRET

Same credential, different label. One integration's secret could fill any of them.

The one that's actually different is NOTION_TOKEN_V2 (nnbb, ijjk-nb) — that's your browser session cookie, not an integration secret.

me:  Create a new Notion setup for nbtn.

 Setting up the Notion side for nbtn now — new integration, database, and a test post. I'll build and deploy once that comes back.

 

nbtn's Notion setup is done and the build is verified. Integration "nbtn-blog" and database "nbtn Blog Posts" are live, with a Test Post carrying the coffee cover — and the local static export renders it: homepage shows the post and cover, post page works. The fixes are committed locally (9f49f74): static props instead of server-side, plain <img> instead of next/image (Next 12.1's export rejects the default image loader), API stub removed, plus the Workers and Pages workflows.

To go live I need two things from you:

  • a fresh PAT for brightmann/nbtn, with Contents + Workflows + Secrets — so I can push and set the repo secrets myself
  • a Cloudflare token (Edit Cloudflare Workers template) for the CLOUDFLARE_API_TOKEN secret.

me: the github pat here...

 

Pushed — commit 9f49f74 is on main, remote restored. Both workflows ran, and both failed for one reason only: the two Notion secrets are empty (the log shows blank values, then the same "Invalid request URL" my dummy-env test had). The code itself compiles fine on the runners.

The PAT you pasted can't set secrets (no Secrets scope) and can't enable Pages (no Administration scope), so two quick steps from you in the repo Settings:

Secrets → Actions → New repository secret:

Pages → Build and deployment → GitHub Actions (same as you set for nbl/snbn)

Once those are in, I'll re-run both workflows and verify the live sites. The PAT stays valid until then — I'll tell you when it can be revoked.

me: NOTION_DATABASE is not set as NOTION_DATABASE_ID like before?

 Right — the name just has to match what the code reads. nbtn's code uses process.env.NOTION_DATABASE, while snbn and rw's code reads NOTION_DATABASE_ID. Same kind of value (the database ID), different label per template.

me:  NOTION_DATABASE and NOTION_KEY need adding as repo secret?

 Yes — the workflows read them from repo secrets, and the runners can't see anything else. That's why both runs failed with blank values. Same as the CLOUDFLARE_API_TOKEN you already added. Once they're in, I'll re-run both workflows.

me: done.

GitHub Pages is live: https://brightmann.github.io/nbtn/ — homepage shows Test Post with the coffee cover, post page loads. Push-to-live works there now.

Workers is blocked on the token: the deploy failed with a Cloudflare auth error — the token is missing User → User Details → Read, which wrangler needs to resolve the account. Fix it on the dashboard (Profile → API Tokens → edit the token → add User Details: Read), or create a fresh one from the "Edit Cloudflare Workers" template and update the repo secret. Once that's done, tell me and I'll trigger the deploy again.

me: 


 

 

 me: what to do?

 

That red error is the problem: the token has a Zone policy with an empty row ("Choose a zone resource"), and a Workers deploy token doesn't need zone access at all. Do this:

  1. Click the red trash icon on the Edit Zone policy block to delete the whole thing.
  2. Add the account as the resource instead — an Account policy scoped to Luckypoem@gmail.com's Account.
  3. In the permission groups below, make sure these two are checked:
    • Workers Scripts → Edit (under Account / Developer Platform)
    • User Details → Read (under User — this is the one wrangler complained about)
  4. Save. Editing keeps the same token value, so the GitHub secret stays valid — no need to update it.

If the screen fights back, the simpler path is to delete this token and create a fresh one from the "Edit Cloudflare Workers" template, which has exactly those permissions and no zone policy — then update the repo secret with the new value.

Tell me when it's saved and I'll re-trigger the deploy.

me: done.

 

nbtn is live on both surfaces, verified:

Your token fix worked — the last failure was just the missing compatibility_date in the config, which I added. Both workflows are green now, so pushes auto-deploy.

The PAT can be revoked now — all pushes are done. One thing to remember: adding a row in the Notion database alone doesn't rebuild the site; re-run a workflow (or push anything) to put a new post live.

 

In Notion, on your database page: click the + at the right end of the table header, name it Slug, type Text.

One catch, though: nbtn doesn't use slugs — its post URLs are the Notion page IDs (/posts/42063c58-...). A Slug column would just sit there unused unless I change the code to build routes from it. Want me to wire that in so posts live at /posts/<slug>?

me: yes.

 Slug code is in and builds clean — with no Slug column yet it falls back to the page ID, exactly as designed. I'm waiting on the Notion column now; once it's set I'll verify /posts/test-post renders and push it live.

 

Slugs are live on both surfaces — Test Post is now at /posts/test-post, homepage links to it, verified on Workers and Pages.

One note: you'd already added the column yourself as lowercase slug — I renamed it to Slug, since the code reads that exact name. The old /posts/<page-id> URL now 404s, and any post without a slug still falls back to its page ID.

 

王昭君, 她是四大美人里最惨的一个,却活成了汉朝最狠的赢家

 

寫漢字、吃閩菜、信媽祖,琉球和福建為什麼親成這樣?

唐高宗李治裝了十年孫子,扳倒權傾朝野的親舅舅,滅了三代帝王啃不下的硬骨頭,最後卻被老婆武則天搶走一切