使用hexo+coding搭建免费个人博客
1.检测node和npm
先检测一下有没有node.js和npm
$ node -v
//如果有,说明node.js安装成功!
$ node -v
v8.4.0
//如果有,说明npm安装成功!
$npm -v
$ npm -v
5.3.0

2.安装hexo
在git-bash中运行以下命令安装hexo
安装hexo全局
$ npm install -g hexo-cli
建立文件夹
hexo init blog
cd blog
npm install
然后运行
$ npm install
就能够建立起一个本地的服务器,端口是4000,打开浏览器 http://localhost:4000 就能访问属于你自己的博客了。

3.切换主题
主题代码拷贝
主题的拷贝也是直接使用 git 即可,首先进入到你博客的根目录,再打开 git-bash 运行
git clone https://github.com/iissnan/hexo-theme-next themes/next
启用主题
在博客根目录下找到 _config.yml 文件,找到里面的 theme,改为
theme: next
这时再运行一次 hexo s ,看看主题有没有生效吧。
4.发布到coding
前提是你先注册一个coding账号
hexo 提供了一个部署命令 hexo deploy,首先需要安装一下 hexo-deployer-git插件
npm install hexo-deployer-git --save
然后配置一下_config.yml 文件:
deploy:
  type: git
  repoistory: https://git.coding.net/codinggq/problog.git
  branch: master
预览效果
在 coding 上建立一个私人仓库,找到代码的 coding 地址,填好上面的配置,然后直接执行
hexo deploy
不出意外的话会让你填写 coding 的用户名和密码完成上传操作。如果你有配置 ssh 方式的话就更加方便了。
这个时候再到 coding 对应的项目里面打开 pages 服务,根据 coding 建议,因为不是 jekyll 项目,所以需要再新建一个.nojekyll 文件(空文件就行,其实不建立也行),等上一会就能够访问自己的博客了。
最后运行以下命令上传到coding
$ hexo g
$ hexo d
如果不行用git,输入以下命令
mkdir problog
cd problog
git init
echo "# problog" >> README.md
git add README.md
git commit -m "first commit"
git remote add origin https://git.coding.net/codinggq/problog.git
git push -u origin master
NEXT主题配置文件示例:
# ---------------------------------------------------------------
# Site Information Settings
# ---------------------------------------------------------------
# Put your favicon.ico into `hexo-site/source/` directory.
favicon: /favicon.ico
# Set default keywords (Use a comma to separate)
keywords: "观奇笔记"
# Set rss to false to disable feed link.
# Leave rss as empty to use site's feed link.
# Set rss to specific value if you have burned your feed already.
rss:
# Specify the date when the site was setup
#since: 2015
# ---------------------------------------------------------------
# Menu Settings
# ---------------------------------------------------------------
# When running the site in a subdirectory (e.g. domain.tld/blog), remove the leading slash (/archives -> archives)
menu:
  home: /
  # categories: /categories
  about: /about
  archives: /archives
  # tags: /tags
  commonweal: /404.html
# Enable/Disable menu icons.
# Icon Mapping:
#   Map a menu item to a specific FontAwesome icon name.
#   Key is the name of menu item and value is the name of FontAwsome icon. Key is case-senstive.
#   When an question mask icon presenting up means that the item has no mapping icon.
menu_icons:
  enable: true
  #KeyMapsToMenuItemKey: NameOfTheIconFromFontAwesome
  home: home
  about: user
  categories: th
  tags: tags
  archives: archive
  commonweal: heartbeat
# ---------------------------------------------------------------
# Scheme Settings
# ---------------------------------------------------------------
# Schemes
#scheme: Muse
scheme: Mist
#scheme: Pisces
# ---------------------------------------------------------------
# Font Settings
# - Find fonts on Google Fonts (https://www.google.com/fonts)
# - All fonts set here will have the following styles:
#     light, light italic, normal, normal intalic, bold, bold italic
# - Be aware that setting too much fonts will cause site running slowly
# - Introduce in 5.0.1
# ---------------------------------------------------------------
font:
  enable: true
  # Uri of fonts host. E.g. //fonts.googleapis.com (Default)
  host:
  # Global font settings used on <body> element.
  global:
    # external: true will load this font family from host.
    external: true
    family: monaco,"PingFang SC",sans-serif,"Microsoft YaHei"
  # Font settings for Headlines (h1, h2, h3, h4, h5, h6)
  # Fallback to `global` font settings.
  headings:
    external: true
    family:
  # Font settings for posts
  # Fallback to `global` font settings.
  posts:
    external: true
    family:
  # Font settings for Logo
  # Fallback to `global` font settings.
  # The `size` option use `px` as unit
  logo:
    external: true
    family: Lobster Two
    size: 24
  # Font settings for <code> and code blocks.
  codes:
    external: true
    family: monaco,consolas, Menlo,
    size: 16
# ---------------------------------------------------------------
# Sidebar Settings
# ---------------------------------------------------------------
# Social Links
# Key is the link label showing to end users.
# Value is the target link (E.g. GitHub: https://github.com/iissnan)
social:
  GitHub: https://github.com/hardesyy
  微博: http://weibo.com/hardesyy
  知乎: https://www.zhihu.com/people/fengjun17
# Social Links Icons
# Icon Mapping:
#   Map a menu item to a specific FontAwesome icon name.
#   Key is the name of the item and value is the name of FontAwsome icon. Key is case-senstive.
#   When an globe mask icon presenting up means that the item has no mapping icon.
social_icons:
  enable: true
  # Icon Mappings.
  # KeyMapsToSocalItemKey: NameOfTheIconFromFontAwesome
  GitHub: github
  微博: weibo
  知乎: weibo
# Sidebar Avatar
# in theme directory(source/images): /images/avatar.jpg
# in site  directory(source/uploads): /uploads/avatar.jpg
#avatar:
# Table Of Contents in the Sidebar
toc:
  enable: true
  # Automatically add list number to toc.
  number: true
# Creative Commons 4.0 International License.
# http://creativecommons.org/
# Available: by | by-nc | by-nc-nd | by-nc-sa | by-nd | by-sa | zero
#creative_commons: by-nc-sa
#creative_commons:
sidebar:
  # Sidebar Position, available value: left | right
  position: left
  #position: right
  # Sidebar Display, available value:
  #  - post    expand on posts automatically. Default.
  #  - always  expand for all pages automatically
  #  - hide    expand only when click on the sidebar toggle icon.
  #  - remove  Totally remove sidebar including sidebar toggler.
  display: post
  #display: always
  #display: hide
  #display: remove
# Blogrolls
links_title: Links
#links_layout: block
#links_layout: inline
links:
  刘洋: http://www.lyblog.net/
  廖雪峰: http://www.liaoxuefeng.com/
  阮一峰: http://www.ruanyifeng.com/blog/
  FED: http://taobaofed.org/
  FEX: http://fex.baidu.com/
  奇舞团: http://www.75team.com/
  AlloyTeam: http://www.alloyteam.com/
  CDC: http://cdc.tencent.com/
  ISUX: http://isux.tencent.com/
  TGideas: http://tgideas.qq.com/
  Nodejs API: http://nodeapi.ucdok.com/
# ---------------------------------------------------------------
# Misc Theme Settings
# ---------------------------------------------------------------
# Custom Logo.
# !!Only available for Default Scheme currently.
# Options:
#   enabled: [true/false] - Replace with specific image
#   image: url-of-image   - Images's url
custom_logo:
  enabled: true
  image: https://coding.net/static/project_icon/scenery-15.png
# Code Highlight theme
# Available value:
#    normal | night | night eighties | night blue | night bright
# https://github.com/chriskempson/tomorrow-theme
highlight_theme: night eighties
# Automatically scroll page to section which is under <!-- more --> mark.
scroll_to_more: true
# Automatically Excerpt. Not recommand.
# Please use <!-- more --> in the post to control excerpt accurately.
auto_excerpt:
  enable: false
  length: 150
# Wechat Subscriber
#wechat_subscriber:
  #enabled: true
  #qcode: /path/to/your/wechatqcode ex. /uploads/wechat-qcode.jpg
  #description: ex. subscribe to my blog by scanning my public wechat account
# 打赏
reward_comment: 坚持原创技术分享,您的支持将鼓励我继续创作!
wechatpay: /uploads/wxpay.png
alipay: /uploads/alipay.jpg
# ---------------------------------------------------------------
# Third Party Services Settings
# ---------------------------------------------------------------
# MathJax Support
mathjax:
  enable: false
  cdn: //cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML
# Swiftype Search API Key
#swiftype_key:
# Baidu Analytics ID
#baidu_analytics:
# Duoshuo ShortName
duoshuo_shortname: "fengjun"
# Disqus
#disqus_shortname:
# Baidu Share
# Available value:
#    button | slide
#baidushare:
##  type: button
# Share
#jiathis:
#add_this_id:
# Share
duoshuo_share: true
# Google Webmaster tools verification setting
# See: https://www.google.com/webmasters/
#google_site_verification:
# Google Analytics
#google_analytics:
# CNZZ count
#cnzz_siteid:
# Make duoshuo show UA
# user_id must NOT be null when admin_enable is true!
# you can visit http://dev.duoshuo.com get duoshuo user id.
duoshuo_info:
  ua_enable: true
  admin_enable: true
  user_id: 0
  admin_nickname: "冯教授"
# Facebook SDK Support.
# https://github.com/iissnan/hexo-theme-next/pull/410
facebook_sdk:
  enable: false
  app_id:       #<app_id>
  fb_admin:     #<user_id>
  like_button:  #true
  webmaster:    #true
search:
  path: search.xml
  field: post
  format: html
  limit: 10000
# Show number of visitors to each article.
# You can visit https://leancloud.cn get AppID and AppKey.
leancloud_visitors:
  enable: true
  app_id: "icBW7OnYytaPAOf6yjFE7a1M-gzGzoHsz"
  app_key: "uclxPv0g8Ebku9LNqoD5XX1B"
# Show PV/UV of the website/page with busuanzi.
# Get more information on http://ibruce.info/2015/04/04/busuanzi/
busuanzi_count:
  # count values only if the other configs are false
  enable: false
  # custom uv span for the whole site
  site_uv: true
  site_uv_header: <i class="fa fa-user"></i>
  site_uv_footer:
  # custom pv span for the whole site
  site_pv: true
  site_pv_header: <i class="fa fa-eye"></i>
  site_pv_footer:
  # custom pv span for one page only
  page_pv: true
  page_pv_header: <i class="fa fa-file-o"></i>
  page_pv_footer:
# Tencent analytics ID
tencent_analytics: "59595400"
# Enable baidu push so that the blog will push the url to baidu automatically which is very helpful for SEO
baidu_push: true
#! ---------------------------------------------------------------
#! DO NOT EDIT THE FOLLOWING SETTINGS
#! UNLESS YOU KNOW WHAT YOU ARE DOING
#! ---------------------------------------------------------------
# Motion
use_motion: true
# Fancybox
fancybox: true
# since
since: 2013
# Wechat Subscriber
wechat_subscriber:
  enabled: true
  qcode: /uploads/wechat-qcode.jpg
  description: 扫一扫,关注我!
# Script Vendors.
# Set a CDN address for the vendor you want to customize.
# For example
#    jquery: https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js
# Be aware that you should use the same version as internal ones to avoid potential problems.
vendors:
  # Internal path prefix. Please do not edit it.
  _internal: vendors
  # Internal version: 2.1.3
  jquery:
  # Internal version: 2.1.5
  # http://fancyapps.com/fancybox/
  fancybox:
  fancybox_css:
  # Internal version: 1.0.6
  # https://github.com/ftlabs/fastclick
  fastclick:
  # Internal version: 1.9.7
  # https://github.com/tuupola/jquery_lazyload
  lazyload:
  # Internal version: 1.2.1
  # http://VelocityJS.org
  velocity:
  # Internal version: 1.2.1
  # http://VelocityJS.org
  velocity_ui:
  # Internal version: 0.7.9
  # https://faisalman.github.io/ua-parser-js/
  ua_parser:
  # Internal version: 4.4.0
  # http://fontawesome.io/
  fontawesome:
# Assets
css: css
js: js
images: images
# Theme version
version: 5.0.1
5.写在最后
这是一种比较经济实惠的搭建专属于自己个人博客的方法。
最后,祝愿大家程序员节日快乐!

使用hexo+coding搭建免费个人博客的更多相关文章
- 使用hexo+github搭建免费个人博客详细教程
		[TOC] 本文目录(注意无法点击): 前言 体验更加排版请访问原文链接:http://blog.liuxianan.com/build-blog-website-by-hexo-github.htm ... 
- 使用hexo+github搭建免费个人博客详细教程(转载)
		https://www.cnblogs.com/liuxianan/p/build-blog-website-by-hexo-github.html 1.上传文档的hexo常用命令 2.输入hexo ... 
- hexo+github搭建自己的博客
		之前很早就想用hexo弄一个自己独立的博客了,在博客园也写了很多的博客,不过不喜欢博客园的风格.不过今天,终于折腾成功了,用hexo搭建了一个在github写的博客,开心,后面会将自己以前的博客慢慢迁 ... 
- 基于hexo+github搭建一个独立博客
		一直听说用hexo搭建一个拥有自己域名的博客是很酷炫的事情~,在这十一花上半个小时整个hexo博客岂不美哉. 使用Hexo吸引我的是,其简单优雅, 而且风格多变, 适合程序员搭建个人博客,而且支持多平 ... 
- 用 Hexo + Github 搭建自己的博客
		扯在前面 在很久很久以前,一直就想搭建属于自己的一个博客,但由于各种原因,最终都不了了之,恰好最近突然有了兴趣,于是就自己参照网上的教程,搭建了属于自己的博客. 至于为什么要搭建自己的博客了?哈哈,大 ... 
- hexo干货系列:(一)hexo+gitHub搭建个人独立博客
		前言 一直想要一个自己的独立博客,但是觉得申请域名+服务器的太麻烦了就一直没有实现.偶然机会发现Hexo这个优秀的静态博客框架,再搭配现在流行的gitHub,简直是完美写博客的黄金搭档(免费+方便). ... 
- 利用 Hexo + Github 搭建自己的博客
		扯在前面 在很久很久以前,一直就想搭建属于自己的一个博客,但由于各种原因,最终都不了了之,恰好最近突然有了兴趣,于是就自己参照网上的教程,搭建了属于自己的博客. 至于为什么要搭建自己的博客了?哈哈,大 ... 
- HEXO快速搭建自己的博客
		关注我,每天都有优质技术文章推送,工作,学习累了的时候放松一下自己. 本篇文章同步微信公众号 欢迎大家关注我的微信公众号:「醉翁猫咪」 很多人有自己的博客,那么你想要吗?利用Hexo就可以搭建专属自己 ... 
- 在github上搭建免费的博客
		github好多年前,大家都开始玩啦,我这个菜鸟近几年才开始.github不仅可以管理项目,还可以搭建博客.技术人员,一般用的博客为博客园,CSDN多一些.看到朋友们都弄一个,我也开始弄起来,先找点资 ... 
随机推荐
- [z] How can we render CSS3 in a WebBrowser Control ?
			http://www.pedautreppe.com/post/How-can-we-render-CSS3-in-a-WebBrowser-Control-.aspx 
- FTP上传下载--python
			import socket import struct import json import subprocess import os class MYTCPServer: address_famil ... 
- VC++知识点整理
			1.内联函数 定义:定义在类体内的成员函数,即函数的函数体放在类体内 特点:在调用处用内联函数体的代码来替换,用于解决程序的运行效率问题.一定要在调用之前定义,并且内联函数 ... 
- Java程序设计16——Annotatio注释
			Annotation是代码里的特殊标记,这些标记可以在编译.类加载.运行时被读取,并执行相应的处理.通过使用Annotation,程序开发人员可以在不改变原有逻辑的情况下,在源文件嵌入一些补充信息.代 ... 
- __lll_mutex_lock_wait的错误原因
			1. x86_64栈(glib 2.4): free时: (gdb) bt #0 0x00002b9405ea1c38 in __lll_mutex_lock_wait () from /lib64 ... 
- Thrift线程和状态机分析
			目录 目录 1 1. 工作线程和IO线程 1 2. TNonblockingServer::TConnection::transition() 2 3. RPC函数被调用过程 3 4. 管道和任务队列 ... 
- Hdu1560 DNA sequence(IDA*)                                                                                            2017-01-20 18:53             50人阅读              评论(0)              收藏
			DNA sequence Time Limit : 15000/5000ms (Java/Other) Memory Limit : 32768/32768K (Java/Other) Total ... 
- 目前主流编译器对C++11特性的支持情况
			目前主流编译器对C++11特性的支持情况 1. GCC编译器(从编译器GCC4.8.X的版本完全支持) (1)目前C++11特性,之前成为C++0X特性,从GCC4.3的后续版本中逐步对C++11进行 ... 
- CodeForces - 669D——(思维题)
			Little Artem is fond of dancing. Most of all dances Artem likes rueda — Cuban dance that is danced b ... 
- [c# 20问] 3.String和string的区别
			POINTS string类型为继承自object的sealed类. string类实例用来存储Unicode字符串. string关键字是System.String类的别名,因此既可以定义strin ... 
