Contribute
This guide is a comprehensive resource for contribute to imuxin’s blog - for both new and experienced contributors. If you got any good ideas, I welcome your contributions to this blog.
Quick Reference
Here are the basic steps needed to get set up and contribute a patch. This is meant as a checklist, once you know the basics. For complete instructions please see the about page.
Install and set up
gitand other dependencies (see the about page for detailed information).Fork the imuxin’s blog repository to your GitHub account and get the source code using.
1
2$ git clone https://github.com/<your_username>/blog
$ cd blogInstall project node denpendencies:
1
$ npm install
Run:
1
$ npm run start
Browser the website
http://localhost:4000/blogto check the blog.
Create Your Post
I recommend to use markdown to write the post, and all the site’s posts are using markdown. Next, I will show you how to create your post. Let’s dive into the details.
Use
hexocommand to create post:1
$ hexo new <your_post_title_name>
After the command executed sucessfully, you can see
.md and the same name folder under the path /source/_posts/. Edit your post content in the markdown file,.md, and once image or other file needed, put them under the same name folder as the post. Create commit and push it.
Before you create commit, you need to generate static files first by using the following command.1
$ npm run docs
1
2$ git add . && git commit -m 'Add a new post, <your_post_title_name>'
$ git push -u origin masterCreate pull request to the origin repository. This is a basic usage of GitHub, I will not show the details.
I wish you do sync step to make your repository is the latest to the origin repository.
Good Luck!