tizhi:基于静态站点技术的体质自测工具项目

用户可快速搭建体质自测单页网站,支持本地预览和部署到GitHub Pages。核心功能为体质自测,亮点是部署简单,更新便捷,适合个人或小团队快速上线使用。【此简介由AI生成】

Branch1Tags0

体质自测

单页静态站点,可部署到 GitHub Pages。

本地预览

# 任选一种
npx --yes serve .
python -m http.server 8080

浏览器打开 http://localhost:8080(端口以终端输出为准)。

部署到 GitHub Pages

1. 在 GitHub 新建仓库

  • 登录 https://github.com/new
  • 仓库名示例:tizhi(任意英文名即可)
  • 选 Public(免费 Pages 需公开仓库;Pro 账户可用私有仓库)
  • 不要勾选 “Add a README”(本地已有文件时再推)

2. 推送本目录到 GitHub

在项目目录 d:\Code\tizhi 执行(把 你的用户名 换成 GitHub 用户名):

git init
git add index.html README.md
git commit -m "Add constitution quiz static site"
git branch -M main
git remote add origin https://github.com/你的用户名/tizhi.git
git push -u origin main

首次推送会要求登录 GitHub(浏览器或 Personal Access Token)。

3. 开启 Pages

  1. 打开仓库 → Settings → 左侧 Pages
  2. Build and deployment → Source 选 Deploy from a branch
  3. Branch 选 main,文件夹选 / (root),点 Save
  4. 等 1~3 分钟,页面顶部会出现站点地址

4. 访问地址

项目站(仓库名 tizhi 时):

https://你的用户名.github.io/tizhi/

根目录的 index.html 会自动作为首页,无需写 /index.html。

更新网站

改完 index.html 后:

git add index.html
git commit -m "Update quiz"
git push

Pages 会在 push 后自动重新部署(通常几分钟内生效)。

Introduction

用户可快速搭建体质自测单页网站,支持本地预览和部署到GitHub Pages。核心功能为体质自测,亮点是部署简单,更新便捷,适合个人或小团队快速上线使用。【此简介由AI生成】

Customize your domain