Personal blog address, stamp my jump, welcome to exchange and study with me, can leave a message in the message area, common progress!
This method is based on (Hexo+Github) and requires only a Github account.
1. Download and install Node. js and NPM.
2. Install git environment, fool-proof installation method, the default installation is ok, after installation, right-click the mouse in any position, as shown in the following figure, it indicates that the installation is successful.
3. Create a github account and create a new repository with the following format: name.github
4. Install Hexo, create a new folder somewhere on your computer (eg: Blog), go to that folder from the command line, and follow these steps to install it
– the installation hexonpm install hexo -g
– Check whether the installation is successfulhexo -v
– Initializes the folderhexo init
– Install required componentshexo install
– Experience Hexohexo g
– Open the server and officially access the URL to experience hexo, enter localhost:4000 to accesshexo s
If the following figure is displayed, the server is successfully started
If no, port conflict may occur. Run the following command to switch portshexo server -p
When the following page appears, it indicates that the basic framework of the blog has been set up successfully
5. Associate Hexo with GitHub, configure name and email (ps: ignore those already configured), and right-click Git Bash in the blog folder to configure Git Bash
git config --global user.name 'your github name'
git config --global user.email 'your github email'
5.1 Enter ssh-keygen -t rsa -c “[email protected]” and press Enter three times to generate a key. The id_rsa and id_rsa.pub files are displayed. C: \ Users \ Administrator. SSH).
5.2 Run eval “$(ssh-agent-s)” to add the key to the Ssh-agent.
5.3 Run ssh-add ~/. SSH /id_rsa to add the generated SSH key to the ssh-agent.
5.4 Log in to GitHub, click Setting in the profile picture drop-down menu, and add SSH
5.5 Create a new SSH Key and enter the name and Key (the Key in the id_rsa.pub file)
6. Locate the _config.yml file in the root folder and modify the configuration according to the following figure
7. Start blogging by typing in the command to create your first blog
hexo new post 'blogName'