2022年关于hexo部署到github,css和jquery显示不出的问题最详细总结

html-css011

2022年关于hexo部署到github,css和jquery显示不出的问题最详细总结,第1张

    node  -v

    显示版本号

    npm  -v

    显示版本号

    git --version

    显示版本号

    去guthub官网注册账号和密码,步骤不过多说明

    是否切换镜像,由你自己决定,这里不做过多切换步骤说明

    输入命令:

    npm install hexo-cli -g

    完成之后可以输入命令

    hexo -v

    显示:版本号

    电脑上创建自己的文件夹,我创建的是blog,之后cd blog,

    如果这些前面的命令都不成功,那么需要系统用户,mac的命令是

    前面加 sudo hexo -v 以此类推

    进入blog后输入

    hexo init blog

    hexo n ”我的第一篇博客“

    hexo clean 

    hexo g

    hexo s    进行本地预览

本地预览效果生效后,安装输入:

npm install hexo-deployer-git

安装完成后,这里我没有切换淘宝的镜像,所以,很多时候都会连接很久,就断开,重新连接。

输入

vi  _config.yml

之后再github进行创建仓库,之后进行kongtiao.github.io.git(我的账号)这样格式创建,xxx.git.io.git格式

在_config.yml里面内容的

deploy:

type : git

repo: [email protected]:Xue1008/kongtiao.github.io.git 

branch: main

注意点:1.这里branch 以前是master 但是后面2019年后github更新,变为了main ,

               2.repo:这里的冒号 要有一个空格之后再输入内容,没有空格,后面hexo上传时候会报错

               3.repo :你之后的也不是加入https://这样,hexo更新之后,如果输入的是htpps的,那么你上传时候会报错。说无法上传。所以必须是在github里面点击ssh,之后点击复制。

在显示内容URL:

这一步是最重要的,不然等会部署到github后就会显示不出css、jquery样式

url: http://example.com

root:kongtiao.github.io.git 

注意:都是有空格后在输入内容

之后点击esc

 输入:

 :wq 

保存退出

再次进行输入 hexo     clean 

hexo g

hexo d

《GitHub精选》是我们分享Github中优质项目的栏目,包括技术、学习、实用与各种有趣的内容。本期推荐的是一个使用纯CSS实现动画加载效果的项目——SpinKit。

SpinKit通过使用transform和opacity属性实现了包括方块翻转、圆点旋转、圆环缩放和九宫格渐变等10余种动画加载的效果。

部分效果代码:

其他效果:

GitHub: https://github.com/tobiasahlin/SpinKit

将一下内容复制进去

# GitHub Start

192.30.253.112 github.com

192.30.253.119 gist.github.com

151.101.100.133 assets-cdn.github.com

151.101.100.133 raw.githubusercontent.com

151.101.100.133 gist.githubusercontent.com

151.101.100.133 cloud.githubusercontent.com

151.101.100.133 camo.githubusercontent.com

151.101.100.133 avatars0.githubusercontent.com

151.101.100.133 avatars1.githubusercontent.com

151.101.100.133 avatars2.githubusercontent.com

151.101.100.133 avatars3.githubusercontent.com

151.101.100.133 avatars4.githubusercontent.com

151.101.100.133 avatars5.githubusercontent.com

151.101.100.133 avatars6.githubusercontent.com

151.101.100.133 avatars7.githubusercontent.com

151.101.100.133 avatars8.githubusercontent.com

# GitHub End

cmd内输入命令ipconfig /flushdns刷新dns缓存,ipconfig /displaydns查看dns缓存

打开github