CloudFlarePage

category
tags
type
status
slug
date
password
Last edited time
Apr 28, 2024 10:17 AM
summary
icon

前言

参考haixin的文章《NotionNext建站-cloudflare版》,这里做了优化
部署效果预览
CloudFlare版本是静态导出的,不支持实时更新文章,每次更改Notion内容后请手动部署站点。此方案适用于站点访问量大,而文章更新不频繁的用户。 需要实时更新请使用Vercel\Netlify\Zeabur\VPS部署方案

开始

访问CloudFlarePage
 

创建项目

notion image
  1. 直接连接git
    1. notion image
  1. 导入项目
    1. notion image
  1. 选择分支
    1. 分支选择 deploy/cloudflare-support
      在4.0.9之后的版本中,可以直接使用main分支部署,无需切换分支
      notion image

      配置参数

      来到页面下方的构建设置:
      • 构建命令填
        • 输出根目录 out
        notion image

    环境变量

    配置效果如下
    notion image
    配置说明
    变量名称
    NODE_VERSION
    16
    VERCEL_ENV
    production
    NOTION_PAGE_ID
    {您的Notion页面id}
    最后点击保存并部署即可。

    完成部署

    页面中心会显示您的访问域名
    notion image
     
     

    FAQ

    部署失败?如果你的构建日志中出现:
    可能是CLoudFlare升级环境导致不兼容,解决方法:降级为旧版构建环境,然后点击重试
    notion image
    notion image

    绑定域名

    项目主页找到自定义域,找到下方设置自定义域
    notion image
    填写域名并继续
    notion image
    按照要求在域名服务商后台配置一个CNAME转发
    notion image
    • CNAME转发示例
      • notion image
    • 点击下方的激活域,由于我使用的域名商本身就是cloudflare,故此步骤只需几秒即可完成验证。
      • notion image
    Web3.0-4EverLandZeabur云部署
    Loading...
    ✨ 更新日志
    🚀 安装部署
    ✒ 写作指引
    🛠 站点配置
    📊 网站统计
    ⭐ 主题配置
    📩 评论插件
    🧷 外部插件
    🔊 站点订阅
    ⌨ 开发指引
    👨‍👦‍👦 联系方式
    🤝 合作共赢