时间: 2020-09-1|tag: 20次围观|0 条评论

参考1
参考2
参考3

$ hexo server  =>  $ hexo s$ hexo deploy  =>  $ hexo d$ hexo generate  =>  $ hexo g$ hexo deploy -generate  =>  $ hexo d -g
使用Hexo 搭建博客插图
image.png

使用Hexo 搭建博客插图1
image.png

使用Hexo 搭建博客插图2
image.png

上传到网上

  • hexo generate
  • hexo deploy
    输入账户密码
使用Hexo 搭建博客插图3
张宁乐

next主题配置

  1. 进行推送

推送一般分三步
hexo clean
hexo generate (或者hexo g)
hexo deploy (或者hexo d)

本地测试
hexo clean
hexo s --debug
二、写文章
在blog目录下执行创建文章指令

1 $ hexo new "blog1"
2 INFO Created: ~/blog/source/_posts/blog1.md

然后修改source/_posts/blog1.md文件:

$ vim source/_posts/blog1.md
1 ---
2 title: blog1
3 date: 2016-08-25 18:50:03
4 tags:
5 ---
6
7 我的第一篇文章!
清理后启动,就可以看到博客中新增加的文章了。
$ hexo clean
$ hexo s --debug
next 主题配置文件

├── .github            #git信息├── languages          #多语言|   ├── default.yml    #默认语言|   └── zh-Hans.yml      #简体中文|   └── zh-tw.yml      #繁体中文├── layout             #布局,根目录下的*.ejs文件是对主页,分页,存档等的控制|   ├── _custom        #可以自己修改的模板,覆盖原有模板|   |   ├── _header.swig    #头部样式|   |   ├── _sidebar.swig   #侧边栏样式|   ├── _macro        #可以自己修改的模板,覆盖原有模板|   |   ├── post.swig    #文章模板|   |   ├── reward.swig    #打赏模板|   |   ├── sidebar.swig   #侧边栏模板|   ├── _partial       #局部的布局|   |   ├── head       #头部模板|   |   ├── search     #搜索模板|   |   ├── share      #分享模板|   ├── _script        #局部的布局|   ├── _third-party   #第三方模板|   ├── _layout.swig   #主页面模板|   ├── index.swig     #主页面模板|   ├── page           #页面模板|   └── tag.swig       #tag模板├── scripts            #script源码|   ├── tags           #tags的script源码|   ├── marge.js       #页面模板├── source             #源码|   ├── css            #css源码|   |   ├── _common    #*.styl基础css|   |   ├── _custom    #*.styl局部css|   |   └── _mixins    #mixins的css|   ├── fonts          #字体|   ├── images         #图片|   ├── uploads        #添加的文件|   └── js             #javascript源代码├── _config.yml        #主题配置文件└── README.md          #用GitHub的都知道

第二步和第三步可以精简为hexo d -g或者hexo g -d。
这时候,在浏览器输入*.github.io,应该能看到之前你在本地测试的时候看到的网页了。
hexo 写作注意
新建文章,新建标签
多说评论

创建新页面
hexo new page about

个人网站地址:http://cherryblog.site/,顺便求个fork

附录1:站点配置文件

 # Hexo Configuration## Docs: https://hexo.io/docs/configuration.html## Source: https://github.com/hexojs/hexo/# Site   站点信息title: Cherry's Blog    #站点名字subtitle: To Be a Batter Me  #副标题description: 做更好的自己   #站点描述,在侧边栏显示author: Cherry   #博主名字email: 991939332@qq.com #联系邮箱language: zh-Hans   #使用的语言包,语言包在主题文件的language文件夹下,可以更改网站显示出的文案timezone:# URL## If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/'url: http://yoursite.comroot: /permalink: :year/:month/:day/:title/permalink_defaults:# Directorysource_dir: sourcepublic_dir: publictag_dir: tagsarchive_dir: archivescategory_dir: categoriescode_dir: downloads/codei18n_dir: :langskip_render:# Writingnew_post_name: :title.md # File name of new postsdefault_layout: posttitlecase: false # Transform title into titlecaseexternal_link: true # Open external links in new tabfilename_case: 0render_drafts: falsepost_asset_folder: true  #新建一个页面后自动生成一个同名文件夹(默认为false)relative_link: falsefuture: truehighlight:  enable: true  line_number: true  auto_detect: false  tab_replace:# Category & Tagdefault_category: uncategorizedcategory_map:tag_map:# Date / Time format## Hexo uses Moment.js to parse and display date## You can customize the date format as defined in## http://momentjs.com/docs/#/displaying/format/date_format: YYYY-MM-DDtime_format: HH:mm:ss# Pagination## Set per_page to 0 to disable paginationper_page: 10pagination_dir: page# Extensions## Plugins: https://hexo.io/plugins/## Themes: https://hexo.io/themes/theme: next# Deployment## Docs: https://hexo.io/docs/deployment.htmldeploy:  type: git  repository: https://github.com/sunshine940326/sunshine940326.github.io.git  #repository: ssh://git@github.com/sunshine940326/sunshine940326.github.io

测试是否成功运行

hexo clean清理一下目录,
hexo g重新生成一次所有的文档,
hexo s运行服务器以后,就可以查看评论效果了,效果可以预览我的博客
hexo d
上传

经典的next主题
hexo主题大全
主题1
主题2
主题3
主题4
hexo 爬坑文章
免费域名

文章转载于:https://www.jianshu.com/p/65c8b6de1cb2

原著是一个有趣的人,若有侵权,请通知删除

本博客所有文章如无特别注明均为原创。
复制或转载请以超链接形式注明转自起风了,原文地址《使用Hexo 搭建博客
   

还没有人抢沙发呢~