1. 新建GitHub仓库名为<username>.github.io。
  2. 安装Node.js及Git。
  3. 安装hexo:
    npm install -g hexo-cli
  4. 切换到要保存hexo博客的目录<blog>,执行
    hexo init

    或直接执行

    hexo init <folder>
    cd <folder>

    然后执行

    npm install
  5. 安装主题,以Next为例:切换到博客文件夹下后执行
    git clone https://github.com/theme-next/hexo-theme-next themes/next
  6. 编辑<blog>/_config.yml,填写title、subtitle、description、keywords、author、language。将url填写为http://<username>.github.io。如果之前使用的是旧版hexo需要参考Hexo版本升级和Next主题升级之坑更新后在time_format后添加update_option: 'mtime'。将theme改为next。添加plugin:
    plugin:
    - hexo-generator-feed
    feed:type: atompath: atom.xmllimit: 20
    search:path: search.xmlfield: postformat: htmllimit: 10000

    添加Deployment配置:

    deploy:type: gitrepository: https://github.com/<username>/<username>.github.io.gitbranch: master
  7. 编辑<blog>/themes/next。更改scheme: Pisces。启用Dark Mode:将darkmode设置为true。启用commonweal等目录,将相应句子前的注释井号删掉。修改social配置,其中Google一栏plus.google已停用。links: Title:可添加其他地址。follow_me配置会在每篇文章末尾添加一个图标指向各个网站的链接,没必要。calendar配置将calendar_id改为Google邮箱,api_key需要在Google API Console,新建项目,然后在“API和服务”一栏下的“信息中心”一栏的页面中选择“ENABLE APIS AND SERVISES"如图:
    搜索API和服务:
    搜索Google Calendar:
    点击Google Calendar API后点击“启用”,然后“创建凭据”:
    点击“选择”选择Google Calendar API,然后点击“API密钥”创建。
    github_banner配置中将enable设置为true,permalink设置为https://github.com/<username>。将pjax设置为true。
  8. 新建博文:执行
    hexo new CSDN-1

    会显示

    INFO  Created: D:\Documents\Programming\Aykablog\source\_posts\CSDN-1.md

    其中标准命令为

    hexo new [layout] <title>

    [layout]可选项默认为post。

  9. 执行
    hexo generate

    hexo g

    显示

    INFO  Start processing
    INFO  Files loaded in 370 ms
    INFO  Deleted: images/arrow-right-32x32-next.png
    INFO  Deleted: images/arrow-right-16x16-next.png
    INFO  Deleted: images/arrow-right.eps
    INFO  Deleted: images/arrow-right.png
    INFO  Deleted: lib/font-awesome/HELP-US-OUT.txt
    INFO  Deleted: lib/font-awesome/css/font-awesome.css.map
    INFO  Deleted: images/arrow-right.svg
    INFO  Deleted: images/quote-l.svg
    INFO  Deleted: images/quote-r.svg
    INFO  Deleted: lib/font-awesome/bower.json
    INFO  Deleted: lib/font-awesome/fonts/fontawesome-webfont.woff
    INFO  Deleted: lib/font-awesome/fonts/fontawesome-webfont.woff2
    INFO  Deleted: lib/font-awesome/css/font-awesome.css
    INFO  Deleted: lib/font-awesome/css/font-awesome.min.css
    INFO  Deleted: lib/font-awesome/fonts/fontawesome-webfont.eot
    INFO  Deleted: images/arrow-right.ico
    INFO  Deleted: images/41254968094E73320D03EFF9B33277C03C1168186.jpg
    INFO  Generated: content.json
    INFO  Generated: board/index.html
    INFO  Generated: about/index.html
    INFO  Generated: tags/index.html
    INFO  Generated: categories/index.html
    INFO  Generated: archives/index.html
    INFO  Generated: archives/2020/index.html
    INFO  Generated: archives/2020/03/index.html
    INFO  Generated: tags/tutorial/index.html
    INFO  Generated: 2020/03/18/hello-world/index.html
    INFO  Generated: 2020/03/19/paper/index.html
    INFO  Generated: index.html
    INFO  Generated: js/algolia-search.js
    INFO  Generated: js/schemes/muse.js
    INFO  Generated: js/next-boot.js
    INFO  Generated: js/bookmark.js
    INFO  Generated: js/local-search.js
    INFO  Generated: css/main.css
    INFO  Generated: js/schemes/pisces.js
    INFO  Generated: js/utils.js
    INFO  Generated: lib/pjax/index.d.ts
    INFO  Generated: lib/font-awesome/webfonts/fa-regular-400.woff2
    INFO  Generated: lib/pjax/LICENSE
    INFO  Generated: lib/pjax/lib/abort-request.js
    INFO  Generated: lib/pjax/example/example.js
    INFO  Generated: lib/pjax/lib/execute-scripts.js
    INFO  Generated: lib/pjax/package.json
    INFO  Generated: lib/pjax/lib/is-supported.js
    INFO  Generated: lib/font-awesome/css/all.min.css
    INFO  Generated: lib/pjax/index.js
    INFO  Generated: lib/pjax/lib/foreach-selectors.js
    INFO  Generated: lib/pjax/lib/foreach-els.js
    INFO  Generated: lib/pjax/CHANGELOG.html
    INFO  Generated: lib/pjax/lib/parse-options.js
    INFO  Generated: lib/pjax/lib/eval-script.js
    INFO  Generated: lib/pjax/example/page2.html
    INFO  Generated: lib/pjax/lib/send-request.js
    INFO  Generated: lib/pjax/example/page3.html
    INFO  Generated: lib/pjax/example/forms.html
    INFO  Generated: lib/pjax/pjax.js
    INFO  Generated: lib/font-awesome/webfonts/fa-brands-400.woff2
    INFO  Generated: lib/pjax/example/index.html
    INFO  Generated: lib/pjax/README.html
    INFO  Generated: lib/font-awesome/webfonts/fa-solid-900.woff2
    INFO  Generated: lib/pjax/pjax.min.js
    INFO  Generated: lib/pjax/tests/setup.js
    INFO  Generated: lib/pjax/lib/switches-selectors.js
    INFO  Generated: lib/pjax/lib/uniqueid.js
    INFO  Generated: lib/pjax/lib/events/trigger.js
    INFO  Generated: lib/pjax/lib/switches.js
    INFO  Generated: lib/pjax/tests/test.ts
    INFO  Generated: lib/pjax/lib/events/on.js
    INFO  Generated: lib/pjax/lib/proto/parse-element.js
    INFO  Generated: lib/pjax/lib/events/off.js
    INFO  Generated: lib/pjax/lib/proto/log.js
    INFO  Generated: lib/pjax/lib/proto/attach-form.js
    INFO  Generated: lib/pjax/lib/util/extend.js
    INFO  Generated: lib/pjax/lib/proto/attach-link.js
    INFO  Generated: lib/pjax/lib/proto/handle-response.js
    INFO  Generated: lib/pjax/lib/util/contains.js
    INFO  Generated: lib/pjax/lib/util/clone.js
    INFO  Generated: lib/pjax/lib/util/update-query-string.js
    INFO  Generated: lib/pjax/lib/util/noop.js
    INFO  Generated: lib/pjax/tests/lib/proto/attach-form.js
    INFO  Generated: lib/pjax/tests/lib/util/clone.js
    INFO  Generated: lib/pjax/tests/lib/eval-scripts.js
    INFO  Generated: lib/pjax/tests/lib/abort-request.js
    INFO  Generated: lib/pjax/tests/lib/is-supported.js
    INFO  Generated: lib/pjax/tests/lib/execute-scripts.js
    INFO  Generated: lib/pjax/tests/lib/foreach-els.js
    INFO  Generated: lib/pjax/tests/lib/foreach-selectors.js
    INFO  Generated: lib/pjax/tests/lib/parse-options.js
    INFO  Generated: lib/pjax/tests/lib/events.js
    INFO  Generated: lib/pjax/tests/lib/switches.js
    INFO  Generated: lib/pjax/tests/lib/util/contains.js
    INFO  Generated: lib/pjax/tests/lib/switch-selectors.js
    INFO  Generated: lib/pjax/tests/lib/uniqueid.js
    INFO  Generated: lib/pjax/tests/lib/send-request.js
    INFO  Generated: lib/pjax/tests/lib/util/noop.js
    INFO  Generated: lib/pjax/tests/lib/util/extend.js
    INFO  Generated: lib/pjax/tests/lib/proto/attach-link.js
    INFO  Generated: lib/pjax/tests/lib/proto/parse-element.js
    INFO  Generated: lib/pjax/tests/lib/util/update-query-string.js
    INFO  Generated: lib/pjax/tests/lib/proto/handle-response.js
    INFO  84 files generated in 932 ms
  10. 执行
    hexo server

    hexo s

    显示

    INFO  Start processing
    INFO  Hexo is running at http://localhost:4000 . Press Ctrl+C to stop.

    打开浏览器打开该网址即可预览。

  11. 如果没有更新,则需要执行

    hexo clean

    后重新生成并启动服务器。

  12. 执行
    npm install hexo-deployer-git --save

    注意此处必须为--save选项,全局安装无效报错:

    INFO  Validating config
    ERROR Deployer not found: git

    执行

    hexo deploy

    hexo d

    将博客部署到GitHub上:

    INFO  Validating config
    INFO  Deploying: git
    INFO  Setting up Git deployment...
    Initialized empty Git repository in D:/Documents/Programming/HexoBlog/.deploy_git/.git/
    [master (root-commit) 9cfa1ad] First commit1 file changed, 0 insertions(+), 0 deletions(-)create mode 100644 placeholder
    INFO  Clearing .deploy_git folder...
    INFO  Copying files from public folder...
    INFO  Copying files from extend dirs...
    warning: LF will be replaced by CRLF in 2019/07/27/CSDN-1/index.html.
    The file will have its original line endings in your working directory
    warning: LF will be replaced by CRLF in 2020/03/19/paper/index.html.
    The file will have its original line endings in your working directory
    warning: LF will be replaced by CRLF in 2020/09/27/CSDN-2/index.html.
    The file will have its original line endings in your working directory
    warning: LF will be replaced by CRLF in 2020/09/28/hello-world/index.html.
    The file will have its original line endings in your working directory
    warning: LF will be replaced by CRLF in about/index.html.
    The file will have its original line endings in your working directory
    warning: LF will be replaced by CRLF in archives/2019/07/index.html.
    The file will have its original line endings in your working directory
    warning: LF will be replaced by CRLF in archives/2019/index.html.
    The file will have its original line endings in your working directory
    warning: LF will be replaced by CRLF in archives/2020/03/index.html.
    The file will have its original line endings in your working directory
    warning: LF will be replaced by CRLF in archives/2020/09/index.html.
    The file will have its original line endings in your working directory
    warning: LF will be replaced by CRLF in archives/2020/index.html.
    The file will have its original line endings in your working directory
    warning: LF will be replaced by CRLF in archives/index.html.
    The file will have its original line endings in your working directory
    warning: LF will be replaced by CRLF in board/index.html.
    The file will have its original line endings in your working directory
    warning: LF will be replaced by CRLF in categories/CSDN/index.html.
    The file will have its original line endings in your working directory
    warning: LF will be replaced by CRLF in categories/index.html.
    The file will have its original line endings in your working directory
    warning: LF will be replaced by CRLF in css/main.css.
    The file will have its original line endings in your working directory
    warning: LF will be replaced by CRLF in index.html.
    The file will have its original line endings in your working directory
    warning: LF will be replaced by CRLF in js/algolia-search.js.
    The file will have its original line endings in your working directory
    warning: LF will be replaced by CRLF in js/bookmark.js.
    The file will have its original line endings in your working directory
    warning: LF will be replaced by CRLF in js/local-search.js.
    The file will have its original line endings in your working directory
    warning: LF will be replaced by CRLF in js/motion.js.
    The file will have its original line endings in your working directory
    warning: LF will be replaced by CRLF in js/next-boot.js.
    The file will have its original line endings in your working directory
    warning: LF will be replaced by CRLF in js/schemes/muse.js.
    The file will have its original line endings in your working directory
    warning: LF will be replaced by CRLF in js/schemes/pisces.js.
    The file will have its original line endings in your working directory
    warning: LF will be replaced by CRLF in js/utils.js.
    The file will have its original line endings in your working directory
    warning: LF will be replaced by CRLF in lib/anime.min.js.
    The file will have its original line endings in your working directory
    warning: LF will be replaced by CRLF in lib/font-awesome/css/all.min.css.
    The file will have its original line endings in your working directory
    warning: LF will be replaced by CRLF in lib/velocity/velocity.min.js.
    The file will have its original line endings in your working directory
    warning: LF will be replaced by CRLF in lib/velocity/velocity.ui.min.js.
    The file will have its original line endings in your working directory
    warning: LF will be replaced by CRLF in tags/Adobe/index.html.
    The file will have its original line endings in your working directory
    warning: LF will be replaced by CRLF in tags/Adobe安装错误/index.html.
    The file will have its original line endings in your working directory
    warning: LF will be replaced by CRLF in tags/Visual-Studio-Installer-Error/index.html.
    The file will have its original line endings in your working directory
    warning: LF will be replaced by CRLF in tags/index.html.
    The file will have its original line endings in your working directory
    warning: LF will be replaced by CRLF in tags/tutorial/index.html.
    The file will have its original line endings in your working directory
    [master 1d6cbde] Site updated: 2020-09-28 00:53:3750 files changed, 15669 insertions(+)create mode 100644 2019/07/27/CSDN-1/index.htmlcreate mode 100644 2020/03/19/paper/index.htmlcreate mode 100644 2020/09/27/CSDN-2/index.htmlcreate mode 100644 2020/09/28/hello-world/index.htmlcreate mode 100644 about/index.htmlcreate mode 100644 archives/2019/07/index.htmlcreate mode 100644 archives/2019/index.htmlcreate mode 100644 archives/2020/03/index.htmlcreate mode 100644 archives/2020/09/index.htmlcreate mode 100644 archives/2020/index.htmlcreate mode 100644 archives/index.htmlcreate mode 100644 board/index.htmlcreate mode 100644 categories/CSDN/index.htmlcreate mode 100644 categories/index.htmlcreate mode 100644 css/main.csscreate mode 100644 images/algolia_logo.svgcreate mode 100644 images/apple-touch-icon-next.pngcreate mode 100644 images/avatar.gifcreate mode 100644 images/cc-by-nc-nd.svgcreate mode 100644 images/cc-by-nc-sa.svgcreate mode 100644 images/cc-by-nc.svgcreate mode 100644 images/cc-by-nd.svgcreate mode 100644 images/cc-by-sa.svgcreate mode 100644 images/cc-by.svgcreate mode 100644 images/cc-zero.svgcreate mode 100644 images/favicon-16x16-next.pngcreate mode 100644 images/favicon-32x32-next.pngcreate mode 100644 images/logo.svgcreate mode 100644 index.htmlcreate mode 100644 js/algolia-search.jscreate mode 100644 js/bookmark.jscreate mode 100644 js/local-search.jscreate mode 100644 js/motion.jscreate mode 100644 js/next-boot.jscreate mode 100644 js/schemes/muse.jscreate mode 100644 js/schemes/pisces.jscreate mode 100644 js/utils.jscreate mode 100644 lib/anime.min.jscreate mode 100644 lib/font-awesome/css/all.min.csscreate mode 100644 lib/font-awesome/webfonts/fa-brands-400.woff2create mode 100644 lib/font-awesome/webfonts/fa-regular-400.woff2create mode 100644 lib/font-awesome/webfonts/fa-solid-900.woff2create mode 100644 lib/velocity/velocity.min.jscreate mode 100644 lib/velocity/velocity.ui.min.jsdelete mode 100644 placeholdercreate mode 100644 tags/Adobe/index.htmlcreate mode 100644 "tags/Adobe\345\256\211\350\243\205\351\224\231\350\257\257/index.html"create mode 100644 tags/Visual-Studio-Installer-Error/index.htmlcreate mode 100644 tags/index.htmlcreate mode 100644 tags/tutorial/index.html
    Enumerating objects: 91, done.
    Counting objects: 100% (91/91), done.
    Compressing objects: 100% (66/66), done.
    Writing objects: 100% (91/91), 260.02 KiB | 6.84 MiB/s, done.
    Total 91 (delta 24), reused 0 (delta 0), pack-reused 0
    remote: Resolving deltas: 100% (24/24), done.
    To https://github.com/yihuajack/yihuajack.github.io.git+ dd9b4c5...1d6cbde HEAD -> master (forced update)
    Branch 'master' set up to track remote branch 'master' from 'https://github.com/yihuajack/yihuajack.github.io.git'.
    INFO  Deploy done: git
  13. 编辑<blog>/source/about/index.md即为“关于”页面。
  14. 编辑<blog>/source/_posts下的相应Markdown文件即可编辑博文。在开头的Front-matter部分可以通过title编辑标题、date编辑日期、tags编辑标签、categories编辑分类。如果多条tags或categories使用语法:
    categories:
    - Diary
    tags:
    - PS3
    - Games

    参考官方文档:https://hexo.io/zh-cn/docs/。

从零开始的hexo与next主题配置github.io博客(入门篇)相关推荐

  1. 【Github】hexo结合Butterfly主题从零开始建github.io博客(待配置butterfly主题,暂停

    从零开始建github.io博客 前言

  2. 搭建自己的github.io博客

    搭建自己的github.io博客 github.io是基于github的repo管理,这意味着咱们对其是有觉得的控制,这个跟放在第三方的平台比,可控性要好太多.下面咱们将详细讲述如何基于github. ...

  3. 如何使用别人的github.io 博客模板

    在搭建自己的github.io 博客的时候,如果我们想使用别人的模板而不是系统给定的主题.则需要开启写轮眼拷贝别人的博客. 1.注册完成后搜索 qiubaiying.github.io 进入我的仓库 ...

  4. hexo搭建github.io博客

    点击上方 "大前端圈"关注, 星标或置顶一起成长 每天早晨08点30分, 第一时间与你相约 Introduction 回顾一下我三年搭建博客的历程,最初是选择wordpress,W ...

  5. hexo的yelee主题修改左上角的博客名字颜色、修改代码模块中的引号内部的字体颜色

    一.修改左上角的博客名字颜色 路径: themes/yelee/source/css/_partial/main.styl 找到下列代码: #header{width:100%;a {color: # ...

  6. hexo+gitHub 个人博客搭建及更换主题历程(特适合入门小白)

    内容涵盖 hexo+gitHub 个人博客搭建 搭建过程中遇到的问题及解决方案 更换主题 1. gitHub 创建博客仓库 (1) 注册Github(如果已注册可以忽略次此步骤) 详细注册步骤请参考: ...

  7. Hexo+github搭建个人博客-博客初始化篇

    文章推荐 精选java等全套学习资源 精选java电子图书资源 精选大数据学习资源 java项目练习精选 上一篇博文 [<Hexo+github搭建个人博客-环境搭建篇>](http:// ...

  8. hexo+github创建个人博客--深入篇

    内容简介 此篇文章介绍的是个人博客的一些配置内容,包含博客项目的介绍.主题配置.图床配置以及各种第三方功能插件的使用,若还未搭建个人博客的哥们可以先参考hexo+github创建个人博客–基础篇搭建出 ...

  9. 利用Hexo搭建个人博客-博客初始化篇

    上一篇博文 <利用Hexo搭建个人博客-环境搭建篇> 中,我们讲解了利用Hexo搭建个人博客应该要配置哪些环境. 相信大家已经迫不及待的想要知道接下来应该要怎么把自己的博客搭起来了,下面, ...

最新文章

  1. AndroidStudio中调试时提示waiting for debugger的奇葩解决
  2. fastapi日志重复打印_【FastAPI】踩坑总结
  3. 【华为云实战开发】6.Cocos游戏项目如何在云端开发
  4. 【英语学习】【English L06】U06 Banking L3 Do you have a credit card?
  5. idea json转为对象_数据存储—JSON
  6. 利用Visio绘制网络拓扑图要注意些什么
  7. 互联网创业团队需要什么样的人
  8. 2022年谷歌Chrome等浏览器在线打开编辑保存微软Office/金山WPS的Word、Excel和PPT技术方案大全
  9. Ubuntu添加开机自动启动程序的方法
  10. 智能电视机顶盒开发记录
  11. pdf.js上传有盖章文件盖章不显示
  12. 图形化显示变量波形 代替串口你知道如何操作么?
  13. donate.ouyangsong.com
  14. 人机大战(类和对象)
  15. 单片机百科知识点---杂七杂八系列
  16. 吴恩达深度学习课后作业course2第三周 超参数调试、Batch正则化和程序框架
  17. 英语语法总结--句子的种类
  18. 键盘研究:按键,键码,键符号
  19. IDEA导入项目无法识别
  20. Django开发实战2-5 模型- 基础条件查询

热门文章

  1. python五子棋游戏控制台版_python实现五子棋游戏(pygame版)
  2. 【视频学习】提高情商,改变人生的读心术
  3. c语言计时程序 纳秒,前端Tips#4 - 用 process.hrtime 获取纳秒级的计时精度
  4. 范伟 赵本山 高秀敏 - 卖拐
  5. 强烈推荐一波高质量的公众号,全是圈内大佬!
  6. 内核内存转储文件(即dump文件)无法产生解决方法
  7. 两个好用的内网穿透工具
  8. kinit: Keytab contains no suitable keys for xxxx@HADOOP.COM while getting initial credentials
  9. 爬虫取列表遇到的问题总结
  10. python 期货交易_Python期货量化交易基础教程(3)