title: 静态博客的创建 categories: - 初始化 toc: true
第一步:下载node
D:\my app\nodejs
第二步:github注册
->Zhang2002GZ.github.io(用户名.github.io)
第三步:下载git
git for windows->cmd+r: git(D:\my app\Git)
第四步:SHH配置
(1)git_bash打开:$ ssh-keygen -t rsa -C "2251787923@qq.com"->回车(4次)直至结束 记住这行Enter file in which to save the key (/c/Users/Administrator/.ssh/id_rsa) 括号里面的地址是后面要用到的 (2)打开github->setting->SHH:title:Zhang2002GZ ;key:粘贴文本文档 user->zhangguozhi->.ssh->.pub 在github上建秘钥
第五步:hexo使用
->文档 npm install hexo-cli -g //安装 hexo init blog //初始化博客 cd blog npm install //hexo server 新建目录blog->cmd+r->D:->cd blog->npm install hexo-cli -g->hexo init myblog->cd myblog->npm install ->hexo s -p 4000 浏览器输入网址:localhost:4000
第六步:sublime安装
->将博客目录直接拖进->## hello hexo
PS:推荐直接在打开方式中选择记事本打开,在记事本里直接修改
第七步:hexo发布至github
hexo->文档->部署repo sublime->_config.yml
开头: \# URL \## Set your site url here. For example, if you use GitHub Page, set url as 'https://username.github.io/project' **url**: https://Zhang2002GZ.github.io 末尾 \# Deployment \## Docs: https://hexo.io/docs/one-command-deployment deploy: **type: git repo: https://github.com/Zhang2002GZ/Zhang2002GZ.github.io.git branch: master**
hexo->文档->部署 hexo g->npm install hexo-deployer-git --save->hexo d
type: git repository: https://github.com/zhang2002gz/zhang2002gz.github.io.git branch: main
hexo init( Start blogging with Hexo!)->静态生成本地的hexo页面hexo s(打开本地服务器:将http://localhost:4000可以看见博客;ctrl+c关闭服务器就看不见页面) ->npm install hexo-deployer-git --save->生成页面hexo g->将本地文件上传github hexo d (error10054:这个保错就执行git config --global http.sslVerify "false") !登入页面弹窗只在第一次创建的时候出现
第八步:美化
git clone GitHub - theme-nexmoe/hexo-theme-nexmoe: 🔥 一个比较特别的 Hexo 主题 themes/nexmoe (git clone 改页面代码所在地址.git 存到themes目录下/新建的nexmoe) sublime修改_config.yml:theme: nexmoe
也可以在release里下载压缩包将它解压到themes中
npm install --save hexo-renderer-pug git clone GitHub - liuyib/hexo-theme-stun: 🦄 An elegant theme for Hexo themes/stun theme: sbun 清理一下hexo clean ,生成一下 hexo g,hexo s(打开服务器),hexo d(上传)
其他
检查:
node -v git --version npm -v hexo -v ssh $ ssh -T git@github.com (Hi zhang2002gz! You've successfully authenticated, but GitHub does not provide shell access.) 查看npm安装hexo插件的情况 npm ls --depth 0 安装缺失的插件 npm install acorn --save
万能三件套:
git config --global --unset http.proxy git config --global --unset https.proxy git config --global http.sslVerify "false"
一些pure主题的配置
hexo-theme-pure/README.cn.md at master · cofess/hexo-theme-pure (github.com)
文章索引目录 title: 文章标题 categories: - 文章分类 tags: - 文章标签 toc: true # 是否启用内容索引 sidebar侧边栏 文章侧边栏默认为开启状态,如果某篇文章不想开启侧边栏,在文章开头配置加入“sidebar: none”即可: title: 文章标题 categories: - 文章分类 tags: - 文章标签 sidebar: none # 是否启用sidebar侧边栏,none:不启用 友情链接 Name: link: http://example.com avatar: http://example.com/avatar.png desc: "这是一个描述" 安装主题 git clone https://github.com/cofess/hexo-theme-pure.git themes/pure 更新主题 cd themes/pure git pull
相关视频
【2021最新版】保姆级Hexo+github搭建个人博客哔哩哔哩bilibili
Hexo博客开发之——WARN No layout index.html - 程序员大本营 (pianshen.com)
title: 一些符号 categories: - 初始化 toc: true
加粗:**文字** 取消加粗:\**文字** 显示\ : \\
> 文字
表格同一格里换行:文字<br/> --- title: 基础知识1 categories: - 智能车 tags: - 笔记 toc: true --- -空格:无序列表(下面那个点,回车会再有一个点) ---回车(下面那个分隔线)