Personal Build Station &MAC installation Hexo

Source: Internet
Author: User
Tags install node rsync using git

Title: Personal Build Station &MAC installation Hexo
Date:2018-04-18 16:34:02
Tags: [mac,blog, personal Build station, Markdown]
---
These two days used markdown to write articles, found very useful. Clear and tidy, with a crisp layout. So, the initiation of the use of support markdown Hexo for personal build station.

Setup 1 installs node. JS:

Hexo's serv is based on node. JS, so first we'll install node. js.
Already installed can be skipped.

The best way to install node. JS is to use NVM.
NVM is the installation Package Manager for node. js.

NVM installation, do not use brew
    • Do not use brew installation, was made to die, terminal one off NVM is not found
    • Do not use brew installation, was made to die, terminal one off NVM is not found
    • Do not use brew installation, was made to die, terminal one off NVM is not found
      Important thing to say three times!!!

1. Using Brew installation (Please ignore)

The Mac can be directly used by the brew installation, without the installation of brew can refer to Method 2.

brew install nvm

Remember to refresh the variable after installation is complete

2.linux installation method to solve the problem of command not FOUND:NVM after terminal shutdown

First clean down.

brew install nvm # brew 安装 nvmnvm --version # 查看版本brew uninstall nvm # 卸载nvm

Curl Mode

curl https://raw.github.com/creationix/nvm/master/install.sh | sh

Wget Way

wget -qO- https://raw.github.com/creationix/nvm/master/install.sh | sh

or directly specify the version

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash

After installation, add global variables in. ZSHRC (using oh-my-zsh) without direct VI creation

VI ~/.ZSHRC

If it's bash, modify the. bash_profile

VI ~/.bash_profile

Add a variable, put the following three lines of code directly, "user/a" is my user root directory

export NVM_DIR="User/a/.nvm"[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"source $NVM_DIR/nvm.sh # 每次启动自动刷新变量

View version
NVM--version # 0.33.2

Installing NPM

NPM is a third-party plug-in tool that installs node. js.

Install the NPM stable version using the following command:

# nvm install stable # 安装稳定版本nvm alias default stable # 指定并安装稳定版本

Of course, you can also install other versions:

nvm install 5.0.0 # 安装 5.0.0 版本nvm install 0.12.7 # 安装 0.12.7 版本

If NVM is not found, reboot the terminal and rerun.

Stable installation is complete, you can see that the current version is 5.6.0 (cutoff time 2018-04-18)

npm -v # 5.6.0
Setup2 Install Hexo Create Hexo folder
mkdir /Users/a/hexocd /Users/a/hexo
Installing Hexo with NPM
npm install -g hexo-cli
To create a site using the init command
hexo init myhome
Compile start
cd myhomehexo g # hexo generate # 编译,生成静态文件hexo s # hexo server # 启动服务

You can see the following information

INFO  Start processingINFO  Hexo is running at http://localhost:4000/.      Press Ctrl+C to stop.

Open Http://localhost:4000/or http://ip:4000 and you can see that our site is already running.

Personality settings

Most of the site configuration information is in the _CONFIG.YML, specific reference Hexo Official document: Configuration

Setup3 Install next Topic

For the official next theme installation, please refer to Next

This time we are installing Ezlippi, this guy's personalized theme based on Next, which is his githup

Download themes using git
Apply Hexo Theme

Vim/users/a/hexo/myhome/_config.yml

Locate the theme field and change its value to next, as follows:

theme: next

For other next configurations, refer to next configuration

Hexo Common Commands
hexo new ‘我的文章‘ # 生成新md文件hexo g # hexo generate # 编译,生成静态文件hexo d # hexo deploy # 部署hexo s # hexo server # 启动服务hexo clean # 清理缓存
Hexo Resources

Take my myhome as an example, the new MD file is stored under source/_posts.

SETUP4 Remote Deployment

Hexo provides one-click deployment capabilities, and we use rsync to deploy code to cloud hosts.

Installing Hexo-deployer-rsync

npm install hexo-deployer-rsync --save

To modify the configuration:

deploy:   type: rsync  host: 111.231.250.221  user: hexouser  root: myhome  port: 22  delete: true  verbose: true  ignore_errors: false
TR class= "even" > TD align= "left" >root
parameters default
host address of remote host
user user name
remote host root directory
p ORT port $
delete true
verbose display debug information true
ignore_errors Ignore error /td> false
    • Host is my own footprint.
    • User is new to Hexo on the host
    • Root is the directory where the deployment files are stored

This is my personal website,

Of course, there are a lot of things not done, nginx agent, next personalization, RSS subscriptions, etc. have not been

I've been busy lately, but I'll do it later.

Reference Documentation:

Jekyll migrating to Hexo to build a personal blog
[Hexo Official documents] (https://hexo.io/zh-cn/docs/)
[Next Official Document] (http://theme-next.iissnan.com/getting-started.html)

Personal Build Station &MAC installation Hexo

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.