Hexo+GitHub搭建自己的博客
来源:互联网 发布:js internal 编辑:程序博客网 时间:2024/06/01 22:57
1、安装 homebrew—->nodejs—->hexo
$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
$ brew install node
$ sudo npm install -g hexo
2.创建一个空的文件夹,CD到文件夹下
$ hexo init
3.生成一套静态网页。运行
$ hexo generate$ hexo server浏览器打开 http://localhost:4000 验证
4.博文提交,makedown编辑.md,移到~/source/_posts
.md 格式title: 定义了博文的标题date: 定义了创作博文的时间tags: 定义了博文的标签除了这个三个属性以外我们还可以扩展一些属性:update: 定义了最后修改的时间comments:定义能否评论此博文(默认为true)categories: 定义了博文的种类
重新
5.部署,_config.yml让hexo帮助我们同步github,方便快捷,配置如下所示
_config.yml 中 deploy: type: git repo: https://github.com/xxx/xxx.github.io.git branch: master xxx为个人github的name $ hexo -d
6.界面修改 ,修改配置内容
# Hexo Configuration ## Docs: https://hexo.io/docs/configuration.html ## Source: https://github.com/hexojs/hexo/ # Site ##修改以适应搜索引擎的收录 title: Hexo ##定义网站的标题 subtitle: ##定义网站的副标题 description: ##定义网站的描述 author: jason jwl ##定义网站的负责人 language: ##定义网站的语言,默认zh-Hans timezone: ##定义网站的时区 # URL ## If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/' url: http://yoursite.com ##定义网站访问的域名 root: / ##定义所在Web文件夹在哪个目录 permalink: :year/:month/:day/:title/ ##定义时间格式 permalink_defaults: # Directory source_dir: source ##定义从哪个文件夹获取博客资料 public_dir: public ##定义生成静态网站到哪个文件夹 archive_dir: archives category_dir: categories code_dir: downloads/code i18n_dir: :lang skip_render: # Writing new_post_name: :title.md # File name of new posts default_layout: post titlecase: false # Transform title into titlecase external_link: true # Open external links in new tab filename_case: 0 render_drafts: false post_asset_folder: false relative_link: false future: true highlight: enable: true line_number: true auto_detect: false tab_replace: # Category & Tag default_category: uncategorized category_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-DD time_format: HH:mm:ss # Pagination ## Set per_page to 0 to disable pagination per_page: 10 ##定义每一页多少条博客 pagination_dir: page # Extensions ## Plugins: https://hexo.io/plugins/ ## Themes: https://hexo.io/themes/ theme: landscape ##定义使用的主题 # Deployment ## Docs: https://hexo.io/docs/deployment.html deploy: type:
7.当你增加新的文章或者插件时,可以通过以下三个命令进行同步操作:
hexo clean hexo generate hexo deploy
阅读全文
0 0
- HEXO+Github,搭建属于自己的博客
- HEXO+Github,搭建属于自己的博客
- HEXO+Github,搭建属于自己的博客
- HEXO+Github,搭建属于自己的博客
- HEXO+Github,搭建属于自己的博客
- Hexo+Github 搭建属于自己的博客
- HEXO+Github,搭建属于自己的博客
- Hexo+Github搭建自己的博客
- 利用github+hexo搭建自己的博客
- 搭建自己的 github + hexo 博客
- HEXO+Github,搭建属于自己的博客
- Hexo+GitHub搭建自己的博客
- hexo+github搭建自己的博客
- hexo+github+域名 搭建自己的博客
- HEXO+Github,搭建属于自己的博客
- Hexo+Github 搭建属于自己的博客
- Hexo+Github/Coding 搭建自己的博客
- 使用HEXO+GitHub搭建自己的博客
- oracle获取Date类型字段无时分秒Data和Timestamp比较
- 小白入门C++ 继承 多态 函数重载
- Httpclient https请求出现Certificates does not conform 解决方法
- VTK基础
- linux下tomcat8的安装
- Hexo+GitHub搭建自己的博客
- 软件危机的表现
- 重要通知|针对新一轮比特币勒索蠕虫病毒的安全建议
- Android
- 浅谈移动Web开发:深入概念
- 如何在移动端设置1px的border
- linux下使用opencv接口函数从摄像头拿图片
- C#加载、显示、移除图片
- unity 下载图片使用并保存在本地