category
tags
type
status
slug
date
summary
icon
password
前言
参考haixin的文章《NotionNext建站-cloudflare版》,这里做了优化
部署效果预览
CloudFlare版本是静态导出的,不支持实时更新文章,每次需要手动部署。
开始
访问CloudFlarePage
创建项目
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fa755c05d-ce7e-492b-9286-0f9627efcc03%2FUntitled.png?table=block&id=bf2d62bf-f7bb-4e4b-8e2b-66f6a15e45bd&t=bf2d62bf-f7bb-4e4b-8e2b-66f6a15e45bd&width=576&cache=v2)
- 直接连接git
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F65d76318-f910-4f86-8d53-6bb905e24e2a%2FUntitled.png?table=block&id=b1b5235a-7d9e-47e1-b735-bd182e438364&t=b1b5235a-7d9e-47e1-b735-bd182e438364&width=1380&cache=v2)
- 导入项目
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F022c0d20-5cf4-4516-9127-c6e9f56578ad%2FUntitled.png?table=block&id=5bd80680-a3ac-47e2-a432-ee4ef050a8ec&t=5bd80680-a3ac-47e2-a432-ee4ef050a8ec&width=984&cache=v2)
环境变量
配置效果如下
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2Fcda0d303-e764-4b5c-b1a4-14e12a50e284%2FUntitled.png?table=block&id=b154d393-7d7e-4037-b9b4-6abe753548e2&t=b154d393-7d7e-4037-b9b4-6abe753548e2&width=943&cache=v2)
配置说明
变量名称 | 值 |
NODE_VERSION | 16 |
VERCEL_ENV | production |
NOTION_PAGE_ID | {您的Notion页面id} |
最后点击保存并部署即可。
完成部署
页面中心会显示您的访问域名
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F30cba4fc-6da3-4a3d-a842-4b0e4443c8ac%2FUntitled.png?table=block&id=24f42178-10ce-48fc-aaa8-851649fc16c7&t=24f42178-10ce-48fc-aaa8-851649fc16c7&width=1077&cache=v2)
绑定域名
项目主页找到
自定义域
,找到下方设置自定义域![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F540d349c-3a54-4ad6-8f35-3c7aab9029f3%2FUntitled.png?table=block&id=a4061d76-7afe-4767-ab3e-8f7b8a19f309&t=a4061d76-7afe-4767-ab3e-8f7b8a19f309&width=1449&cache=v2)
填写域名并继续
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F5ec74a21-2da9-4738-90ab-219b8dff3c4a%2FUntitled.png?table=block&id=af59f49f-1c3a-4153-a5a7-b65dd394b13d&t=af59f49f-1c3a-4153-a5a7-b65dd394b13d&width=1048&cache=v2)
按照要求在域名服务商后台配置一个CNAME转发
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F0ede5959-b1d6-4647-9535-dc6d7931df22%2FUntitled.png?table=block&id=f422f891-7bc2-497a-b3bb-9a4ffd97c3b9&t=f422f891-7bc2-497a-b3bb-9a4ffd97c3b9&width=963&cache=v2)
- CNAME转发示例
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F83f0ce76-4f25-4d79-b3a1-8cd7f05eed54%2FUntitled.png?table=block&id=ecd83556-6479-40c5-a340-059a4954bfca&t=ecd83556-6479-40c5-a340-059a4954bfca&width=1238&cache=v2)
- 点击下方的激活域,由于我使用的域名商本身就是cloudflare,故此步骤只需几秒即可完成验证。
![notion image](https://www.notion.so/image/https%3A%2F%2Fs3-us-west-2.amazonaws.com%2Fsecure.notion-static.com%2F3a5dfe5f-14ed-40b4-bb50-76b94fe68fbd%2FUntitled.png?table=block&id=201678df-2757-4d72-9b09-99b2b47654e3&t=201678df-2757-4d72-9b09-99b2b47654e3&width=1321&cache=v2)
- 作者:Tangly
- 链接:https://blog.tangly1024.com/article/notion-next-cloud-flare
- 声明:本文采用 CC BY-NC-SA 4.0 许可协议,转载请注明出处。