✨ 更新日志
🚀 安装部署
✒ 写作指引
🛠 站点配置
📊 网站统计
⭐ 主题配置
📩 评论插件
🧷 外部插件
🔊 站点订阅
⌨ 开发指引
👨👦👦 联系方式
🤝 购买服务
CloudFlarePage
category
tags
type
status
slug
date
password
Last edited time
Jun 17, 2024 02:15 AM
summary
icon
前言
CloudFlare方案适用于站点访问量大,而文章更新不频繁的用户。
参考haixin的文章《NotionNext建站-cloudflare版》,这里做了优化
部署效果预览
CloudFlare版本是静态导出的,不支持实时更新文章,每次更改Notion内容后请手动部署站点。若需要实时动态更新请使用Vercel\Netlify\Zeabur\VPS部署方案。
开始
访问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=b268ff5e-fb44-46c5-affd-bc8df83b530b&t=b268ff5e-fb44-46c5-affd-bc8df83b530b&width=720&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=2e4689f5-be27-48c6-8216-ff19f8fd8384&t=2e4689f5-be27-48c6-8216-ff19f8fd8384&width=768&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=1d419df4-40d4-4246-b6ef-08382b11d877&t=1d419df4-40d4-4246-b6ef-08382b11d877&width=984&cache=v2)
- 选择分支
环境变量
配置效果如下
![notion image](https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F6c096b44-beb9-48ee-8f92-1efdde47f3a3%2F152320e6-0bba-47c5-8dda-b8edf30a7b56%2FUntitled.png?table=block&id=22fbc0a8-8830-4aa5-ae8b-e96c08895585&t=22fbc0a8-8830-4aa5-ae8b-e96c08895585&width=966&cache=v2)
配置说明
变量名称 | 值 |
NODE_VERSION | 18 |
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=59595db9-8048-44e6-852b-9b9723c0b9e0&t=59595db9-8048-44e6-852b-9b9723c0b9e0&width=1077&cache=v2)
FAQ
部署失败?如果你的构建日志中出现:
可能是CLoudFlare升级环境导致不兼容,解决方法:降级为旧版构建环境,然后点击重试
![notion image](https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F6c096b44-beb9-48ee-8f92-1efdde47f3a3%2F66804e4e-228b-47a6-b8b2-db5549830d2e%2FUntitled.png?table=block&id=ba9a4ae1-d00d-4249-b9a2-59952871e563&t=ba9a4ae1-d00d-4249-b9a2-59952871e563&width=1553&cache=v2)
![notion image](https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F6c096b44-beb9-48ee-8f92-1efdde47f3a3%2F3dfcc002-9e87-458c-8933-cfb732428a35%2FUntitled.png?table=block&id=06ef6e3f-d8b4-49ba-87b3-611f423676ac&t=06ef6e3f-d8b4-49ba-87b3-611f423676ac&width=1333&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=2ec1449b-9bc4-4b33-b6df-972d47250393&t=2ec1449b-9bc4-4b33-b6df-972d47250393&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=56db2dfc-09e9-4e1e-aa72-bd2accd48601&t=56db2dfc-09e9-4e1e-aa72-bd2accd48601&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=67cab9e5-4a69-4688-b0d3-7b8153fd26af&t=67cab9e5-4a69-4688-b0d3-7b8153fd26af&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=13edb7ca-d5d1-44a1-9582-0500ba4592a3&t=13edb7ca-d5d1-44a1-9582-0500ba4592a3&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=e63adf7b-0a7a-4c12-9833-a2e554c0c5f0&t=e63adf7b-0a7a-4c12-9833-a2e554c0c5f0&width=1321&cache=v2)
Loading...
Last update: 2023-03-13