- Hexo is a blog that synchronizes management of multiple computer devices
- I’ve been having a lot of fun with the Hexo blog; Here is to sort out some of the problems left over before and some personalized configuration
- If you have any problems setting up your own blog, please refer to my previous two related blogs
- Build a personal blog based on GitHub and Hexo
- NexT Theme Configuration Optimization – Unearthed Guide
I. Personalized configuration
1. Return to the top button to display the scrolling progress
- Open the theme configuration file
~themes/next/_config.yml
findsidebar
field - the
scrollpercent
Change the property oftrue
Ok, as follows:
sidebar:
# Sidebar Position - the Sidebar Position (only for Pisces | Gemini two styles effectively)
position: left // Keep to the left
#position: right // Position to the right
# Sidebar Display - the Sidebar shows time (only to Muse | Mist two styles effectively)
#display: post // The default behavior to display when the article page has a list of contents
display: always // display it on all pages
#display: hide // Hide on all pages (can be expanded manually)
#display: remove completely //
offset: 12 / / article spacing (only for Pisces | Gemini two styles effectively)
b2t: false / / return the top button (only for Pisces | Gemini two styles effectively)
scrollpercent: true // Returns the percentage of the top button
Copy the code
Two. Multiple device management blog
Normally, the configuration information of our blog is local and not uploaded to the server, so when we want to reinstall the system on other devices, such as the company computer or the original computer, we can no longer maintain our blog
1. Configure the environment
- First you need to configure the environment on your computer
- The installation
Node.js
- The installation
git
- The installation
hexo
- The installation
- For details about how to install it, please refer to GitHub and Hexo to build a personal blog
2. Create a branch
hexo
Generated static blog files are uploadedGitHub
On, and is placed by defaultmaster
Branch, and some related configuration files are localhexo
The source files (deployment environment files) of thehexo
Branch (you can create a new onehexo
Branch), when replacing a new computer, directlygit clone hexo
branch
2-1. Rightusername.github.io
The new warehousehexo
branch
Create a hexo branch in the Github username. Github. IO repository
2-2. Set the default branch
Switch to the hexo branch and set the Default branch to hexo in the repository ->Settings->Branches->Default Branch, save
3. Conduction on the configuration fileGithub
This step needs to be done on the computer where the blog is set up (the computer where the blog profile and theme profile reside)
3 to 1. The cloninghexo
branch
- Will above the new
hexo
Branch clone to local, in terminalcd
Access to theusername.github.io
File directory - Use in the current directory
Git Bash
performgit branch
Command to view the current branch. It should be a new branchhexo
- If you use
Sourcetree
Software management code, cloned to local projects may notusername.github.io
All files are in the root directory, so the operation is not affected. Just remember that the operation is in the root directory of the file
$ git branch
*hexo
Copy the code
3-2. Upload the deployment file
- Start by putting the local blog’s deployment file (
Hexo
Copy all files in the directoryusername.github.io
File directory - Then install some of the plug-ins you need, some of which you may not need, but all of which seem to have no impact
npm install hexo-generator-index --save
npm install hexo-generator-archive --save
npm install hexo-generator-category --save
npm install hexo-generator-tag --save
npm install hexo-server --save
npm install hexo-deployer-git --save
npm install hexo-deployer-heroku --save
npm install hexo-deployer-rsync --save
npm install hexo-deployer-openshift --save
npm install hexo-renderer-marked@0.2 --save
npm install hexo-renderer-stylus@0.2 --save
npm install hexo-generator-feed@1 --save
npm install hexo-generator-sitemap@1 --save
npm install hexo-generator-search --save
npm install hexo-generator-searchdb --save
Copy the code
- The last thing is to say that all the documents are submitted to
hexo
branch - Consider the following considerations when submitting
- Remove the.git directory for the theme within the Themes directory (if there is one) as one Git repository cannot contain another or submitting the theme folder will fail
- In a different place when the theme needs to be updated later
git clone
Download the latest version of the theme, and then copy the content to the current theme directory
- Finally, use terminal or admin tool to submit all files to
hexo
branch
The Master branch and the Hexo branch each maintain a version. The Master branch is used to store static blog resources and provide blog pages for people to visit. The Hexo branch is used to back up the blog deployment files for its own maintenance and updates, and there is no conflict between the two in a GitHub repository
4. Sync to other computers
- The generation of a new computer
ssh key
Added to theGitHub
On the accountssh key
For details, seeBuild a personal blog based on GitHub and Hexo
- Clone on a new computer
username.github.io
The warehousehexo
Branch to local, now localgit
The warehouse is inhexo
branch - Switch to the
username.github.io
Directory, executenpm install
(Because the warehouse has one.gitignore
File, which is ignored by defaultnode_modules
Folder, which means warehousehexo
The branch does not store the directory, so it doesinstall
Below)- if
node_modules
If the file is not lost, do not perform this operation
- if
- Here you can start blogging on your own computer!
- It is important to note that every time you update your blog, you should upload the changes
hexo
branch - Every time you change your computer to update your blog, it’s best to do so before you change it
git pull
Pull up the latest update
Speaking of which, all the relevant issues are basically solved