Skip to content

如何创建一个子站点 (二级网站) How to create a website with subdomain

Notifications You must be signed in to change notification settings

fancn21th/sketch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

如何创建一个子站点

The sketch.fancn21th.cn is temporarily shut since too many cnames there.

先决条件

  • 你需要有一个域名

    到 godaddy.com 上去注册一个你喜欢的域名

  • DNS 配置

    类型 子域名 数据
    CNAME sketch fancn21th.github.io.

新建一个 Github 仓库

本地 创建一个 HTML 项目

本地 编译项目

准备 deploy.sh 文件

推送代码到 Github

注意这里 一定要修改成 main 分支

git remote add origin git@github.com:fancn21th/sketch.git
git branch -M main
git push -u origin main

本地执行 deploy.sh

npm run deploy

Github 上的操作

  • 前往 pages
  • 在 Branch 下 选择 master 分支 点击保存
  • 等待 Custom domain 生效
  • 访问 http://sketch.fancn21th.cn
  • 等待 Enforce HTTPS 生效
  • 勾选 Enforce HTTPS
  • 访问 https://sketch.fancn21th.cn

About

如何创建一个子站点 (二级网站) How to create a website with subdomain

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published