4zhvml8 发表于 2024-7-29 13:51:18

五分钟免费搭建一个自己的网站


    <h3 style="color: black; text-align: left; margin-bottom: 10px;">所<span style="color: black;">运用</span>到的工具</h3>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">1.git</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">2.nodejs</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">3.hexo</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">4.gitee</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">默认你<span style="color: black;">已然</span>安装了Git和NodeJS(不会的<span style="color: black;">自动</span>百度,安装教程<span style="color: black;">非常多</span>)</p>
    <h3 style="color: black; text-align: left; margin-bottom: 10px;"><span style="color: black;">为么</span><span style="color: black;">运用</span>Gitee而不是GitHub</h3>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">日前</span>国内<span style="color: black;">拜访</span>GitHub速度慢,还可能被墙,<span style="color: black;">因此</span>Gitee来构建个人博客。Gitee类似国内版的GitHub,<span style="color: black;">拜访</span>速度有<span style="color: black;">保准</span>。</p>
    <h3 style="color: black; text-align: left; margin-bottom: 10px;"><span style="color: black;">起始</span>搭建</h3>1. 安装Hexo<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">打开cmd,输入命令</p><span style="color: black;">npm</span> install -g hexo-cli2. 初始化Hexo<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">在你的电脑上创建Hexo文件夹,在Hexo文件夹右键<span style="color: black;">选取</span>Git Bash Here</p>
    <div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/pgc-image/310a162683054b2bb51a91e28ee993f7~noop.image?_iz=58558&amp;from=article.pc_detail&amp;lk3s=953192f4&amp;x-expires=1722821415&amp;x-signature=871WX5oa7wVmOdYHDjmzywok%2Bak%3D" style="width: 50%; margin-bottom: 20px;"></div>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">而后</span>输入命令</p>hexo <span style="color: black;">init</span>
    <div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/pgc-image/29bd0a3e503a4111bc886c111ce22d6f~noop.image?_iz=58558&amp;from=article.pc_detail&amp;lk3s=953192f4&amp;x-expires=1722821415&amp;x-signature=HXnGa5ea0ZhmE23rRGwzwkz0L5s%3D" style="width: 50%; margin-bottom: 20px;"></div>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">初始化完成后Hexo的目录结构:</p>
    <div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/pgc-image/8c613d6fd47a40438d7968aac46108f8~noop.image?_iz=58558&amp;from=article.pc_detail&amp;lk3s=953192f4&amp;x-expires=1722821415&amp;x-signature=KjgzmsC5K6UfzpGz3EvWHzerGbs%3D" style="width: 50%; margin-bottom: 20px;"></div>3. _config.yml对博客进行<span style="color: black;">基本</span>配置<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">_config.yml文件修改,<span style="color: black;">保留</span></p>
    <div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/pgc-image/2a726e7a1cba41d2943f7fe243145d17~noop.image?_iz=58558&amp;from=article.pc_detail&amp;lk3s=953192f4&amp;x-expires=1722821415&amp;x-signature=N4gZ6LntHO%2BpOcisSkf%2BuWA3vuI%3D" style="width: 50%; margin-bottom: 20px;"></div>4. 本地预览博客<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">编译项目,输入命令:hexo g</p>
    <div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/pgc-image/001ffce6abbc4f90a0d93142b945b9a2~noop.image?_iz=58558&amp;from=article.pc_detail&amp;lk3s=953192f4&amp;x-expires=1722821415&amp;x-signature=%2BHhqR7ZAznbAcUC%2FRBW1L2EkZMk%3D" style="width: 50%; margin-bottom: 20px;"></div>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">运行项目,输入命令:hexo s</p>
    <div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/pgc-image/0ff4d3d6ac1d45dabbebd8365a4b7231~noop.image?_iz=58558&amp;from=article.pc_detail&amp;lk3s=953192f4&amp;x-expires=1722821415&amp;x-signature=rbZI%2BSJtthO%2BNtd4ZMiePzuWyuk%3D" style="width: 50%; margin-bottom: 20px;"></div>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">在浏览器中输入<strong style="color: blue;">http://localhost:4000/</strong>就<span style="color: black;">能够</span>看到效果啦,是不是很简单</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">倘若</span>你只是在本地浏览,恭喜你<span style="color: black;">已然</span>完<span style="color: black;">成为了</span></p>
    <h3 style="color: black; text-align: left; margin-bottom: 10px;"><span style="color: black;">安排</span>博客到Gitee上</h3>1. 创建Gitee账号<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">到码云:https://gitee.com/ 上申请注册账号,码云类似国内版的GitHub,<span style="color: black;">因此</span>操作界面跟GitHub差不多,多了<span style="color: black;">有些</span>国产化的东西,<span style="color: black;">这儿</span>不做<span style="color: black;">更加多</span>介绍了,自己<span style="color: black;">科研</span>下。</p>2. 创建项目<div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/pgc-image/39540130c05f4a33a3ba95ad53d453a1~noop.image?_iz=58558&amp;from=article.pc_detail&amp;lk3s=953192f4&amp;x-expires=1722821415&amp;x-signature=Zo5M5p%2Fww7PPBFygq%2F%2FlbjunOA0%3D" style="width: 50%; margin-bottom: 20px;"></div>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">创建完成后,在项目中复制项目<span style="color: black;">位置</span>。</p>3. 在_config.yml中配置Git<span style="color: black;">deploy</span>:
    <span style="color: black;">type</span>: git
    <span style="color: black;">repo</span>: <span style="color: black;">https</span>:<span style="color: black;">//gitee.com/sinee/sinee.git</span>
    <span style="color: black;">branch</span>: master<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">重视</span>:冒号后面<span style="color: black;">必定</span>要有空格,否则<span style="color: black;">不可</span>正确识别。</p>4. 发布到Gitee<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">输入命令安装自动<span style="color: black;">安排</span>发布工具</p>npm <span style="color: black;">install</span> hexo-deployer-git <span style="color: black;">--save</span>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">依次输入以下命令 发布博客,首次发布需要在shell中输入账号和<span style="color: black;">秘码</span>。</p><span style="color: black;">hexo</span> <span style="color: black;">clean</span>
    <span style="color: black;">hexo</span> <span style="color: black;">g</span>
    <span style="color: black;">hexo</span> <span style="color: black;">d</span>
    <div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/pgc-image/c5122ff2d6264b878657495ab95185c7~noop.image?_iz=58558&amp;from=article.pc_detail&amp;lk3s=953192f4&amp;x-expires=1722821415&amp;x-signature=g7NOQHSJiemg4zONQHDfGlUqqXQ%3D" style="width: 50%; margin-bottom: 20px;"></div>5. Gitee Pages设置<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">在项目的服务中<span style="color: black;">选取</span>Pages选项</p>
    <div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/pgc-image/e47a9459a45b43e48632294f2af2e88e~noop.image?_iz=58558&amp;from=article.pc_detail&amp;lk3s=953192f4&amp;x-expires=1722821415&amp;x-signature=FGIwLKtpQ1rzWQe2Xw2unp7%2BWpA%3D" style="width: 50%; margin-bottom: 20px;"></div>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">Pages</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">选取</span> master分支,点击 <span style="color: black;">安排</span>/更新</p>
    <div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/pgc-image/70d19a2ce279413bbf4b5cbb4af52da0~noop.image?_iz=58558&amp;from=article.pc_detail&amp;lk3s=953192f4&amp;x-expires=1722821415&amp;x-signature=jz7EVCHGeXcILFBbbsUvSMw2gQ0%3D" style="width: 50%; margin-bottom: 20px;"></div>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">稍等一会儿博客就发布成功啦,就可预览在线博客啦!!!</p><span style="color: black;">倘若</span>博客的样式不对,则需要在_config.yml中配置下博客<span style="color: black;">位置</span>和路径,<span style="color: black;">而后</span>再执行命令hexo clean &amp;&amp; hexo g &amp;&amp; hexo d 就<span style="color: black;">能够</span>啦
    <div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/pgc-image/757ca0c9ac764629a6143defe881e82c~noop.image?_iz=58558&amp;from=article.pc_detail&amp;lk3s=953192f4&amp;x-expires=1722821415&amp;x-signature=9Ezlw9OvJpym8Eb40k1s7Uzrc3Y%3D" style="width: 50%; margin-bottom: 20px;"></div>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">下面这个是我自己搭建的网站,欢迎<span style="color: black;">大众</span><span style="color: black;">拜访</span>:https://sinee.gitee.io/</p>
    <div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/pgc-image/135d66d891074bd18ee92c4ce214cd06~noop.image?_iz=58558&amp;from=article.pc_detail&amp;lk3s=953192f4&amp;x-expires=1722821415&amp;x-signature=Ia5Z9ZxK%2FlXWvICevwdtoC36flM%3D" style="width: 50%; margin-bottom: 20px;"></div>
    <div style="color: black; text-align: left; margin-bottom: 10px;"><img src="https://p3-sign.toutiaoimg.com/pgc-image/693507e41f7542099d671718b4a8818d~noop.image?_iz=58558&amp;from=article.pc_detail&amp;lk3s=953192f4&amp;x-expires=1722821415&amp;x-signature=5RtLLNWSVRX6Mv8b4oscji7TwiA%3D" style="width: 50%; margin-bottom: 20px;"></div>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">♚</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">尤其</span>说明</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">本教程针对无任何编程经验,所有工具完全免费。<span style="color: black;">大众</span>在搭建网站的过程中遇到任何问题,<span style="color: black;">能够</span>在<span style="color: black;">文案</span>底部留言,<span style="color: black;">亦</span><span style="color: black;">能够</span>在公众号底部添加<span style="color: black;">博主</span><span style="color: black;">微X</span>,看到后会<span style="color: black;">第1</span>时间回复<span style="color: black;">大众</span>。</p>




4lqedz 发表于 2024-10-8 13:47:44

这夸赞甜到心里,让我感觉温暖无比。

1fy07h 发表于 2024-10-19 13:21:17

网站建设seio论坛http://www.fok120.com/

j8typz 发表于 2024-10-30 01:32:25

感谢您的精彩评论,为我带来了新的思考角度。
页: [1]
查看完整版本: 五分钟免费搭建一个自己的网站