一定得会的 GitHub 骚操作之 如何使用 GitHub 免费创建你的个人博客

这一篇主要跟你说说 GitHub 的 pages 功能,我之前也跟你提到过,GitHub 可以让我们免费托管自己的 blog ,我的 blog 就是托管在 GitHub 上的 。

具体介绍链接:

本文隐藏内容 登陆 后才可以浏览
ok,以上,好好用心的去做一个自己的 blog 吧,把自己的思考总结到上面去,挺好。慢慢折腾,网站做好了后,请把你托管在 GitHub 上面的 blog 地址在下方留言中评论出来,大家互相学习。

77 Replies to “一定得会的 GitHub 骚操作之 如何使用 GitHub 免费创建你的个人博客”

  1. Lilian说道:

    踩了好几个坑终于搞定了耶,欢迎来踩lilianhello.github.io

  2. 帅B,你好。我按照你的教程操作到更改配置文档前都没问题。更改了hexo的配置文档后。再运行就出现以下错误。(期间就是通过人root账户更改了_config文件,因为我第一次用ubuntu,普通用户不会改config文件,所以就在网上找了从root桌面登陆教程,进去改了配置文件,然后切换回来运行就报错了)可以帮忙看一下吗?
    aubyn@aubyn-virtual-machine:~/Desktop$ cd aubynchen.github.io
    aubyn@aubyn-virtual-machine:~/Desktop/aubynchen.github.io$ hexo s
    INFO Validating config
    INFO Start processing
    INFO Hexo is running at http://localhost:4000/ . Press Ctrl+C to stop.
    FATAL Something’s wrong. Maybe you can find the solution here: https://hexo.io/docs/troubleshooting.html
    Error: EACCES: permission denied, open ‘/home/aubyn/Desktop/aubynchen.github.io/db.json’
    FATAL
    Error: EACCES: permission denied, open ‘/home/aubyn/Desktop/aubynchen.github.io/db.json’

  3. 博客地址:kelvinweng.github.io
    欢迎光临!
    另外,希望b友能在解决问题的过程中,多多分享方法,这样大家都能一起成长。
    总结一下问题:现在的github创建库时,跟本地计算机的branch不是一样的名字的,这个很重要,导致了branch不一致的问题,github默认是叫“main”,本地是“master”,所以无论是上传还是创建库,一定要匹配一下这个branch名。
    另外,每次上传之后,记得先刷新一下github的库,然后再去尝试博客,不要急着操作,不然github没更新结束,你自己就又进死胡同了。

  4. 走到主题设置那里不行了,hexo s之后,localhost:4000给了几串代码出来,根据warning转到https://github.com/theme-next去拿主题,又提示无法访问,请问哪里出问题了?

  5. 打开404,是由于名字的问题。
    创建hexo的xx.github.io的 xx 必须和github的名字一致。
    参考这个:https://blog.csdn.net/qq_46387376/article/details/124069947

  6. 在安裝的時候遇上了permission的問題
    (base) Chide-Air:~ chowchichung$ npm install hexo-cli -g
    npm ERR! code EACCES
    npm ERR! syscall symlink
    npm ERR! path ../lib/node_modules/hexo-cli/bin/hexo
    npm ERR! dest /usr/local/bin/hexo
    npm ERR! errno -13
    npm ERR! Error: EACCES: permission denied, symlink ‘../lib/node_modules/hexo-cli/bin/hexo’ -> ‘/usr/local/bin/hexo’
    npm ERR! [OperationalError: EACCES: permission denied, symlink ‘../lib/node_modules/hexo-cli/bin/hexo’ -> ‘/usr/local/bin/hexo’] {
    npm ERR! cause: [Error: EACCES: permission denied, symlink ‘../lib/node_modules/hexo-cli/bin/hexo’ -> ‘/usr/local/bin/hexo’] {
    npm ERR! errno: -13,
    npm ERR! code: ‘EACCES’,
    npm ERR! syscall: ‘symlink’,
    npm ERR! path: ‘../lib/node_modules/hexo-cli/bin/hexo’,
    npm ERR! dest: ‘/usr/local/bin/hexo’
    npm ERR! },
    npm ERR! errno: -13,
    npm ERR! code: ‘EACCES’,
    npm ERR! syscall: ‘symlink’,
    npm ERR! path: ‘../lib/node_modules/hexo-cli/bin/hexo’,
    npm ERR! dest: ‘/usr/local/bin/hexo’
    npm ERR! }
    npm ERR!
    npm ERR! The operation was rejected by your operating system.
    npm ERR! It is likely you do not have the permissions to access this file as the current user
    npm ERR!
    npm ERR! If you believe this might be a permissions issue, please double-check the
    npm ERR! permissions of the file and its containing directories, or try running
    npm ERR! the command again as root/Administrator.

    npm ERR! A complete log of this run can be found in:
    npm ERR! /Users/chowchichung/.npm/_logs/2021-09-26T09_58_05_305Z-debug.log

    我上網Google了,嘗試這樣 ,但還是不行-.-
    (base) Chide-Air:~ chowchichung$ sudo chown -R chowchichung ~/.npm
    (base) Chide-Air:~ chowchichung$ sudo chown -R chowchichung /usr/local/lib/node_modules

    有解決方法嗎?

    1. 小帅b说道:

      sudo chown -R chowchichung: /usr/local/lib/node_modules

      或者

      sudo chown -R $USER /usr/local/lib/node_modules

  7. superhandsome0731.github.io 瞧瞧看帅B
    我管理员cmd显示
    Branch ‘master’ set up to track remote branch ‘master’ from ‘https://github.com/superhandsome0731/superhandsome0731.github.io’.
    [32mINFO [39m Deploy done: [35mgit[39m

  8. qinggui说道:

    四个月前看这个,部署到GitHub上面,有没有报错,就是打不开,名字啥的都注意了,百度了捣鼓了半天也没解决。
    现在又操作了一遍,还是这样,快崩溃了。最后没办法,我部署到码云上面了,部署成功真的是兴奋,
    如果有部署到github page上面不成功的伙伴,可以尝试部署到码云

    1. 小帅b说道:

      修改完之后要 clean 一下再生成的。
      另外,访问应该是 xxx.github.io

  9. qyxuan说道:

    修改了目录上的 ./node_modules/gitment/dist/gitment.js, hexo clean,hexo g, hexo d , 操作后修改文件没有提交上去, hexo d 提交文章之类是可以的? 应该如何解决,

    NFO Deploying: git
    INFO Clearing .deploy_git folder…
    INFO Copying files from public folder…
    INFO Copying files from extend dirs…
    位于分支 master
    无文件要提交,干净的工作区
    Username for ‘https://github.com’: qyxuan
    Password for ‘https://[email protected]’:
    分支 ‘master’ 设置为跟踪来自 ‘https://github.com/qyxuan/qyxuan.github.io.git’ 的远程分支 ‘master’。
    Everything up-to-date
    INFO Deploy done: git

  10. 460186458说道:

    博客搭好,qyxuan.github.io , next 主题可正常,但更换其他主题比如Casper , uno的时候 总是出现 No layout: index.html,配置文件的主题名和themes下的目录名是一致的,配置里的空格theme: Casper也是正确的,npm ls –depth 0查看hexo安装也没有提示警告异常

    1. qyxuan说道:

      重新尝试yiliay主题可行,不知道 Casper、 uno为什么不行

  11. 我就躺着说道:

    正式开通了,项目的,访问地址是: https://simpleicy.github.io/mysite/
    github pages的访问域名是这样的。
    A Project Pages site for a personal account is available at http(s)://.github.io/.
    A Project Pages site for an organization account is available at http(s)://.github.io/.
    A User Pages site is available at http(s)://.github.io.
    An Organization Pages site is available at http(s)://.github.io.

    也就是如果你以是github的组织弄的网站,访问地址是 http(s)://组织名.github.io
    同理,以用户名弄的,访问地址是 http(s)://用户名.github.io
    如果你以你组织或用户名的项目弄的,访问地址是 http(s)://组织名(用户名).github.io/项目名

    组织名或用户名统一使用小写,因为域名系统不区分大小写。

    1. 我就躺着说道:

      帅B,我粘贴没使用文本粘贴,另外,访问地址帮助页面地址为:https://help.github.com/en/articles/user-organization-and-project-pages

  12. ll说道:

    安装hexo报错,求解决。
    npm ERR! Linux 5.0.0-23-generic
    npm ERR! argv “/usr/bin/node” “/usr/bin/npm” “install” “hexo” “-g”
    npm ERR! node v8.10.0
    npm ERR! npm v3.5.2

    npm ERR! shasum check failed for /tmp/npm-4316-d90836cb/registry.npmjs.org/lodash.reject/-/lodash.reject-4.6.0.tgz
    npm ERR! Expected: 80d6492dc1470864bbf583533b651f42a9f52415
    npm ERR! Actual: 773069d63f5b377cb9efa42eb1958a1e8144e6f9
    npm ERR! From: https://registry.npmjs.org/lodash.reject/-/lodash.reject-4.6.0.tgz
    npm ERR!
    npm ERR! If you need help, you may report this error at:
    npm ERR!

    npm ERR! Please include the following file with any support request:
    npm ERR! /home/ly/npm-debug.log

  13. 今天也在努力学习说道:

    畅言评论里面,说需要在ICP备案号中填入网站备案号。有人去弄过这个吗?

    1. 小帅b说道:

      备案的话略麻烦,需要买域名然后去备案,畅言用不了就用别的呗

      1. 今天也在努力学习说道:

        必力没法注册,很奇怪、点了没反应

      2. 今天也在努力学习说道:

        试了好几种评论系统,最后还是gitalk成功了

  14. angoe说道:

    还有个问题,我修改了正常文章里的标签和分类,重新hexo clean,g,s之后打开就看不到这个文章了了……

    1. angoe说道:

      再次破案,我这分类要这么写:
      categories: “分类1”

      1. angoe说道:

        我感觉我屠版了,一个提醒,不要用Typora这款markdown编辑器写,有概率出问题,老老实实notepad++啥事儿也没有……

    1. 小帅b说道:

      看到了,不错,以后多总结,做一个执行者~

  15. rlysyy说道:

    之后博客有更新,或者追加怎么在往github上放呢

  16. tao说道:

    ly.github.io
    打得打开吗?
    标题是 mml’s blog
    hello world!
    不是我写的内容
    我的博文在哪里呢
    怎么办

    1. 小帅b说道:

      你这用的是 Octopress 框架? 第一篇是默认的,建议你还是再看看这篇文章的说明!

  17. angoe说道:

    一顿操作之后hexo d完了没反应,打开网址也是404是啥原因

    1. angoe说道:

      噢我忘了在type和repo后面加空格,但是改了再hexo d之后报错误找不到Repository

      1. angoe说道:

        血崩,原来是我建仓库的时候命名是XXX,而不是XXX.github.io……改了名字就好了

        1. Hua Don说道:

          哈哈 兄弟你好逗 我也是个小白 还没开始尝试

          1. 小帅b说道:

            不要尝试,要认真干!

    1. 小帅b说道:

      wordpress 需要后台, php + Mysql ,要有自己的主机才行。

  18. 今天也在努力学习说道:

    请问配置文件里面
    deploy:
    type: git
    repo: https://github.com/xxx/xxxx.github.io.git
    这里中间是XXX是什么?是要在最开始放的那个github生成站点文档里面看着弄吗?
    github的生成站点文档没看懂,第四部分的创建索引文件看得我一头雾水。停止了步伐_(:з」∠)_

    1. 今天也在努力学习说道:

      我又认真看了一遍,好像应该是我自己的github的链接。但是我的链接最后是没有.git的。我在配置文件里面加了.git和没加的这两种方法都试过了,还是打不开网站QAQ

        1. lh说道:

          我好了,好像是因为username.github.io里面username必须是github的username

          1. 今天也在努力学习说道:

            我的设置的ID和github的用户名一样的。还是不行。我已经弄了4遍了。还没找到哪里出问题QAQ

          2. 今天也在努力学习说道:

            我终于成功啦!!是命令超时了。我试了第六次终于搞定了

      1. 小帅b说道:

        就是你仓库的地址,至于怎么查看你远程仓库的地址,我之前讲过!

  19. &娴敲棋子&说道:

    这波操作666~,周末实践起来?

    1. 小帅b说道:

      搞完了之后把博客发出来,证明你实践了

回复 460186458 取消回复