当前位置: 首页 > news >正文

【001】利用github搭建静态网站_essay

文章目录

  • 1. 简介
  • 2. 先了解网址规则
    • 2.1 文件及网址形式
    • 2.2 相互访问
  • 3. 搭建网页的过程
    • 3.1 网页文件
    • 3.2 github搭建仓库及文件上传
    • 3.3 搭建网站

1. 简介

相信大家都有过想要自己搭建一个稳定可靠的网站,github是一个不错的选择,本来国内有gitee可以搭建网站的,奈何塌房了。github目前还是比较稳定的,经久不衰。

但是使用github搭建网站就免不了加载速度比较慢啥的,因此可以适当科学上网。

本文主要针对于小白,并且不是很复杂的网页进行介绍。适当结合AI进行网页设计,更加快捷高效。

2. 先了解网址规则

2.1 文件及网址形式

已上传两个文件在代码仓中,index.htmlwhite.html

后续在生成网址的时候,index.html作为主页使用,输入域名和对应的代码仓名称即可访问。white.html则需要在上面的基础上加上white.html才可以访问。

# 域名/代码仓/     访问index.html
https://muyi-xh.github.io/muyi.github.io/
# 域名/代码仓/文件名    访问white.html等其他文件
https://muyi-xh.github.io/muyi.github.io/white.html

请添加图片描述

2.2 相互访问

可以通过上述提及的网址,在另一个网页的相应控件中加入点击跳转的方式,即可。

3. 搭建网页的过程

3.1 网页文件

现如今建立网页不难,结合AI即可完成。需要更丰富的功能,只需要描述详细即可。

详细AI生成过程不展示了,展示相应的文件,自行复制保存。
index.html

<!DOCTYPE html>
<html lang="zh-CN">
<head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>简约优雅的主页</title><style>* {margin: 0;padding: 0;box-sizing: border-box;}body {font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;min-height: 100vh;display: flex;justify-content: center;align-items: center;background: linear-gradient(135deg, #1a2a6c, #b21f1f, #fdbb2d);overflow: hidden;position: relative;}body::before {content: '';position: absolute;top: 0;left: 0;width: 100%;height: 100%;background: url('https://images.unsplash.com/photo-1506744038136-46273834b3fb?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=2070&q=80') no-repeat center center;background-size: cover;opacity: 0.7;z-index: -1;}.content-container {max-width: 800px;padding: 40px;margin: 20px;background: rgba(255, 255, 255, 0.85);border-radius: 15px;box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);text-align: center;backdrop-filter: blur(10px);border: 1px solid rgba(255, 255, 255, 0.3);animation: fadeIn 1.5s ease-out;}h1 {font-size: 2.8rem;margin-bottom: 25px;color: #2c3e50;font-weight: 600;letter-spacing: -0.5px;}p {font-size: 1.4rem;line-height: 1.8;color: #34495e;margin-bottom: 30px;}.quote {font-style: italic;padding: 20px;border-left: 4px solid #3498db;background: rgba(52, 152, 219, 0.1);border-radius: 0 8px 8px 0;margin: 30px 0;font-size: 1.3rem;text-align: left;}.signature {display: block;text-align: right;font-weight: 500;margin-top: 10px;color: #2980b9;}.decoration {display: flex;justify-content: center;gap: 15px;margin: 30px 0;}.dot {width: 12px;height: 12px;border-radius: 50%;background: #3498db;opacity: 0.7;}@keyframes fadeIn {from {opacity: 0;transform: translateY(30px);}to {opacity: 1;transform: translateY(0);}}@media (max-width: 768px) {.content-container {padding: 30px 20px;}h1 {font-size: 2.2rem;}p {font-size: 1.2rem;}.quote {font-size: 1.1rem;}}@media (max-width: 480px) {h1 {font-size: 1.8rem;}p {font-size: 1.1rem;}}</style>
</head>
<body><div class="content-container"><h1>欢迎来到宁静空间</h1><div class="decoration"><div class="dot"></div><div class="dot"></div><div class="dot"></div></div><p>在喧嚣的世界中,我们都需要一个可以静下心来思考的地方。这个空间没有复杂的干扰,没有无尽的滚动信息,只有你与自己的对话。</p><div class="quote">"简单不是简陋,而是经过深思熟虑后的精致表达。在设计中,减去不必要的元素,留下的才是真正重要的本质。"<span class="signature">— 设计箴言</span></div><p>生活就像这个页面一样,有时我们需要简化,移除那些分散注意力的元素,才能专注于真正重要的事物。</p></div>
</body>
</html>

white.html

<!DOCTYPE html>
<html lang="zh-CN">
<head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>极简主义</title><style>* {margin: 0;padding: 0;box-sizing: border-box;}body {background-color: #ffffff;min-height: 100vh;display: flex;justify-content: center;align-items: center;font-family: 'Helvetica Neue', Arial, sans-serif;transition: background-color 1s ease;}.message {font-size: 3.5rem;font-weight: 300;color: #333;text-align: center;padding: 2rem;max-width: 800px;line-height: 1.3;letter-spacing: -0.5px;position: relative;}.message::after {content: '';position: absolute;bottom: 0;left: 50%;transform: translateX(-50%);width: 100px;height: 2px;background: #333;animation: blink 1.5s infinite;}@keyframes blink {0%, 100% { opacity: 0; }50% { opacity: 1; }}@media (max-width: 768px) {.message {font-size: 2.5rem;}}@media (max-width: 480px) {.message {font-size: 2rem;padding: 1.5rem;}}.footer {position: absolute;bottom: 20px;width: 100%;text-align: center;font-size: 0.9rem;color: #999;letter-spacing: 1px;}</style>
</head>
<body><div class="message">在空白中,我们找到无限的可能性</div><div class="footer">MINIMALISM · SIMPLICITY · ELEGANCE</div>
</body>
</html>

3.2 github搭建仓库及文件上传

① 创建仓库
请添加图片描述
② 上传文件
请添加图片描述
请添加图片描述
请添加图片描述

3.3 搭建网站

选择完成后点击Save,等待网页刷新或者自行刷新,知道在GitHub Pages下面出现网址即可。
请添加图片描述
请添加图片描述
注意每次重新上传文件或者新的文件,此处网页刷新的时间决定了,你的网站是否更新完成。

http://www.xdnf.cn/news/766297.html

相关文章:

  • 并发编程的源头
  • Flink CDC将MySQL数据同步到数据湖
  • C++ 标准输入输出 -- <iostream>
  • 【深度学习新浪潮】多模态模型如何处理任意分辨率输入?
  • LazyOwn RedTeam/APT 框架是第一个具有人工智能驱动的 CC 的 RedTeam 框架
  • 6.linux文本内容显示cat,more,less
  • 第七部分:第五节 - 数据关系与进阶查询 (TypeORM):仓库里复杂的配料组合
  • 第1篇:数据库中间件概述:架构演进、典型方案与应用场景
  • 微服务常用日志追踪方案:Sleuth + Zipkin + ELK
  • SCAU8642--快速排序
  • C++ 内存泄漏检测器设计
  • 7.文本内容处理sort,uniq,out,cat,comm,diff
  • NX869NX874美光固态颗粒NX877NX883
  • [HTML5]快速掌握canvas
  • 在 Linux 服务器上无需 sudo 权限解压/打包 .7z 的方法
  • C++ - 数据处理之数值转不同进制的字符串(数值转十进制字符串、数值转八进制字符串、数值转二进制字符串、数值转十六进制字符串)
  • 黑马程序员C++核心编程笔记--4 类和对象--多态
  • 《信号与系统》--期末总结V1.0
  • linux 的devmem2 调式使用说明
  • Vue-3-前端框架Vue基础入门之VSCode开发环境配置和Tomcat部署Vue项目
  • 常见ADB指令
  • Vue-4-前端框架Vue基础入门之Vue的常用操作
  • opencv调用模型
  • 渗透实战PortSwigger Labs AngularJS DOM XSS利用详解
  • 【MySQL】视图与用户管理
  • linux——文件系统
  • 使用API网关Kong配置反向代理和负载均衡
  • IoTGateway项目生成Api并通过swagger和Postman调用
  • Fisher准则例题——给定类内散度矩阵和类样本均值
  • 数据库系统概论(十六)数据库安全性(安全标准,控制,视图机制,审计与数据加密)