Hexo+Github搭建个人博客(三)

一、相关说明

  • Hexo个性化,添加、删除、修改等
  • 文章发布需要使用Typora软件
  • 博主本地环境:Windows 11家庭中文版、64位操作系统,基于x64的处理器
  • 我的个人博客:Zglao.github.io

二、Hexo个性化

  • 配置文件

    分为站点配置文件主题配置文件

    1
    2
    3
    4
    5
    # 站点配置文件路径
    D:\Blog\_config.yml

    # 主题配置文件
    D:\Blog\themes\Ocean\_config.yml
  • 添加菜单配置

    • Home(首页)、Archives(目录)、Gallery(相册)、About(关于我)、Search(搜索)五部分,其中博客选择的主题中Gallery(相册)、About(关于我)、点击提示没有被找到,需要的话可进行配置

    • About(关于我)

      桌面右键打开Open Git Bash here终端命令行页面,进入D:\Blog路径执行命令hexo new page about,会在路径D:\Blog\source下生成about文件夹以及about文件夹下文件index.md,在index.md文件中编辑内容,编辑完成后,在D:\Blog路径,执行命令hexo clean && hexo g && hexo d上传Github

      1
      2
      3
      4
      5
      6
      7
      8
      9
      10
      11
      12
      13
      14
      15
      16
      17
      18
      Zg Lao@admin MINGW64 ~/Desktop
      $ cd D:\Blog

      Zg Lao@admin MINGW64 /d/Blog
      $ hexo new page about
      INFO Validating config
      INFO Created: D:\Blog\source\about\index.md

      Zg Lao@admin MINGW64 /d/Blog
      $ hexo clean && hexo g && hexo d
      INFO Validating config
      INFO Deleted database.
      INFO Deleted public folder.
      INFO Validating config
      INFO Start processing
      INFO Files loaded in 176 ms
      ...
      INFO Deploy done: git

      执行完成,打开浏览器输入Zglao.github.io进入个人博客查看About(关于)页面

    • Gallery(相册)

      桌面右键打开Open Git Bash here终端命令行页面,进入D:\Blog路径执行命令hexo new page gallery,会在路径D:\Blog\source下生成gallery文件夹以及gallery文件夹下文件index.md,在index.md文件中编辑内容(手动在路径D:\Blog\source下创建文件夹存放相册中的图像,博主命名Gallery Images),编辑完成后,在D:\Blog路径,执行命令hexo clean && hexo g && hexo d上传Github

      1
      2
      3
      4
      5
      6
      7
      8
      9
      10
      11
      12
      13
      14
      15
      16
      17
      18
      Zg Lao@admin MINGW64 ~/Desktop
      $ cd D:\Blog

      Zg Lao@admin MINGW64 /d/Blog
      $ hexo new page gallery
      INFO Validating config
      INFO Created: D:\Blog\source\gallery\index.md

      Zg Lao@admin MINGW64 /d/Blog
      $ hexo clean && hexo g && hexo d
      INFO Validating config
      INFO Deleted database.
      INFO Deleted public folder.
      INFO Validating config
      INFO Start processing
      INFO Files loaded in 180 ms
      ...
      INFO Deploy done: git

      执行完成,打开浏览器输入Zglao.github.io进入个人博客查看Gallery(相册)页面

      博主路径D:\Blog\sourcegallery文件夹下文件index.md内容

  • 修改页面内容配置

    • 修改标题

      打开站点配置文件_comfig.yml,文件路径在D:\Blog,文件最上面

      1
      2
      3
      4
      # Site
      title: Hexo
      subtitle: ''
      description: ''

      修改为

      1
      2
      3
      4
      # Site
      title: 路浩
      subtitle: ''
      description: ''

  • 其他配置和美化

    后续持续补充……