当前位置: 首页 > 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下面出现网址即可。
请添加图片描述
请添加图片描述
注意每次重新上传文件或者新的文件,此处网页刷新的时间决定了,你的网站是否更新完成。

相关文章:

  • 【MySQL】使用C语言连接数据库
  • 房屋租赁系统 Java+Vue.js+SpringBoot,包括房屋信息、看房申请、租赁合同、房屋报修、收租信息、维修数据、租客管理、公告管理模块
  • 机器学习——集成学习
  • 6.2本日总结
  • Oracle的Hint
  • 【GESP真题解析】第 6 集 GESP 三级 2023 年 9 月编程题 1:小杨的储蓄
  • ThreadLocal ,底层原理,强引用,弱引用,内存泄漏
  • 力扣HOT100之多维动态规划:64. 最小路径和
  • 普通二叉树 —— 最近公共祖先问题解析(Leetcode 236)
  • 力扣第452场周赛
  • BiliNote部署实践
  • docker使用sh脚本创建容器
  • mysql离线安装教程
  • 论文略读:LIMO: Less is More for Reasoning
  • Android Studio 之基础代码解析
  • NVM,Node.Js 管理工具
  • 网络地址转换
  • StarRocks物化视图
  • 前端网络协议面试题及解析
  • 前端高频面试题2:JavaScript/TypeScript
  • 建德网站制作公司/软文推广哪个平台好
  • 橙子建站免费吗/百度网盘服务电话6988
  • 粉丝帮女流做的网站/网络广告形式
  • 公司有域名的怎么建设网站/常用的seo工具的是有哪些
  • 网络工程师考试大纲/杭州最好的seo公司
  • 曲靖网站网站建设/刷粉网站推广