利用Github创建自己的博客


tags:

  • Github
  • Hexo
  • NexT

Use Github to create your own blog

Register for Github.io

  1. register for Github account
  2. create a new repository:
    username.github.io

Install Hexo

Env: Ubuntu 16.04

  1. Dependencies:
    • Git
    • NodeJs
    • Hexo
  2. Methods:
    • Git: sudo apt-get install git
    • NodeJs: NodeJs+NPM
      • if you wan to upgrade your nodejs, you could install a module named "n"
      sudo npm install -g -n
      sudo n stable
      
    • Hexo: sudo npm install hexo-cli -g

Write &Publish

  1. initialization
    hexo init username.github.io

  2. configuration

    • install the theme
      cd username.github.io
      use default and popular theme: next
      git clone https://github.com/iissnan/hexo-theme-next themes/next
      for more themes, you can check the links: HEXO THEMEs
    • basic configuration
      edit username.github.io/_config.yml
      Hexo Basic Confs: More Confs
      Notice:
    title: [blog name]
    author: [your name]
    language: [zh-Hans、en]
    theme: __next__
    deploy:
    type: git
    repo: [email protected]:username/username.github.io
    
  3. wirte
    hexo new [layout] "essay name"

    利用Github创建自己的博客_第1张图片
    hexo post scaffolds

  4. test
    hexo s

  5. deploy

    • install hexo-deployer-git hexo-deployer-git tool:
      npm install hexo-deployer-git --save
  6. publish

    • hexo clean
    • hexo g
    • exo d
  7. browse

useful links to learn to build your blog

Hexo: https://hexo.io/
NexT: http://theme-next.iissnan.com/
Individual Settings: 1, 2

你可能感兴趣的:(利用Github创建自己的博客)