基于hexo创建博客(Github托管)
基于hexo的博客
搭建步骤
1.依赖文件下载 Node.js
2.Hexo的安装
3.部署到Github
4.Hexo创建博客基本操作
5.Hexo主题皮肤更换
依赖文件Node.js
首先要安装node,npm 前端支持的基础文件
npm包管理,使用cnpm下载速度更快
npm install -g cnpm --registry=https://registry.npm.taobao.org
Hexo框架安装
1.框架安装
cnpm install -g hexo-cli
2.创建一个空文件夹,在文件下创建博客
mkdir blog
3.hexo 的生成,初始化博客
sudo hexo init
4.博客启动 start
hexo s
可以本地预览
5.编辑新文章
hexo n "文章名称" hexo g 生成
部署到Github
1.安装github部署的工具
cnpm install --save hexo-deployer-git
vim _config.yml
配置文件
# Deployment ## Docs: https://hexo.io/docs/deployment.html deploy: type: git repo: https://github.com/GeekDengshuo/GeekDengshuo.github.io.git branch: master
2.部署命令
hexo d
Hexo创建博客基本操作
// 1.init hexo init [folder] // Initializes a website. If no folder is provided, Hexo will set up the website in the current directory. // 2.new hexo new [layout] <title> // Creates a new article. If no layout is provided, Hexo will use the default_layout from _config.yml. // If the title contains spaces, surround it with quotation marks. //3.generate hexo generate //Option Description //-d, --deploy Deploy after generation finishes //-w, --watch Watch file changes //-b, --bail Raise an error if any unhandled exception is thrown during generation //-f, --force Force regenerate //-c, --concurrency Maximum number of files to be generated in parallel. Default is infinity // 4.publish hexo publish [layout] <filename> // 5.server hexo server // Starts a local server. By default, this is at http://localhost:4000/. //Option Description //-p, --port Override default port //-s, --static Only serve static files //-l, --log Enable logger. Override logger format. // 6.deploy $ hexo deploy //Deploys your website. //Option Description //-g, --generate Generate before deployment // 7.clean $ hexo clean //Cleans the cache file (db.json) and generated files (public). hexo g // hexo generate hexo s // hexo server hexo d // hexo deploy
Hexo主题皮肤更换
1.克隆主题
git clone https://github.com/litten/hexo-theme-yilia 下载主题 git clone https://github.com/litten/hexo-theme-yilia.git themes/yilia // 拷贝到主题目录下
2.修改_config.yml
vim _config.yml
# Extensions ## Plugins: https://hexo.io/plugins/ ## Themes: https://hexo.io/themes/ theme: yilia
reference
相关推荐
JingLisen 2020-01-12
89327060 2020-01-08
87304292 2019-11-23
JingLisen 2020-06-26
hzq0 2020-06-16
蓝亭书序 2020-06-04
Amzaing00 2020-05-11
hzq0 2020-05-10
乾坤一碼農 2020-05-10
gakki的二向箔 2020-05-07
hzq0 2020-05-05
hzq0 2020-05-05
只有代码的世界 2020-04-27
JingLisen 2020-04-23
gakki的二向箔 2020-04-07
89284553 2020-03-09
YULIU 2020-03-07
只有代码的世界 2020-03-04