Skip to content

zhangchunsheng/zhangchunsheng.github.com

Repository files navigation

zhangchunsheng.github.com

Powered by Peter NPM

Peter Personal Homepage

fame0

HOW TO POST BLOG

  1. Fork it
  2. Syncing your fork
  3. Create your blog branch (git checkout -b your-blog)
  4. Write your blog in markdown
  5. Add your blog to _post folder
  6. Add related image to assets folder
  7. Add your info into _data/authors.yml
  8. Commit your changes (git commit -am 'added a blog')
  9. Push to the branch
  10. Create new Pull Request

Done!~

CONTRIBUTE GUIDELINE

1. Add Blog Header

All blog should has title, author, date, teaser...

Example as follows:

---

 title: "'Score Your Face Photo' a ML&Develop practice"
 date: 2017-09-18 09:00 +0800
 author: your_github_username
 header:
   teaser: your_teaser_image_path
---

<!-- markdownlint-disable -->

> Author: [@your_github_username](https://github.com/your_github_username) your one-line bio at here

> Code: [@yourcode](your_code_path)

2. Writing Style

  • Keep all filenames & url as lowercase, and use - to connect words instead of space. e.g. 2017-10-06-develop-pc-impactor instead of 2017-10-06-Develop PC Impactor
  • Find a good image for the blog to make it more beautiful.
  • Embed the photo & video before publishing, save all external file to the blog /assets/${current_year} directory.

3. Add <!--more--> Section

Add <!--more--> section for your abstract part, it will show on the blog homepage, or the blog homepage will show all your blog content.

4. Just Commit Related Files

Please do not commit unrelated files.

5. Add links to anchor in paragraph

The titles in markdown files will be added an anchor automatically, you can use that to add your own anchor links. And here is some of the rules how the blog generate the anchor:

  • convert the title directly to anchor
  • spaces will be replaced by dash -
  • /, &, ? and . will be eliminated
  • Chinese character will be kept in the anchor

Example

Say you have a title as ### 我是? a title.bat. Then you will get the anchor generated as 我是-a-titlebat. And you can use the generated anchor to implement your own links. Like this:

[奇妙的Link](#我是-a-titlebat)

Usage

Jekyll

Install all the Jekyll requirements and run it at localhost for blog preview.

1 Use Docker Compose

This is the recommended way for new users to easy getting started

make docker

2 Install Jekyll by Hand

You should not use this way except you are a Ruby expert.

make install
make serve

Test

In order to make sure everything(file name, file size, etc) is ok, you can run the following command to check them before git push.

npm install
npm test

OTHERS

JEKYLL THEME

minima: https://github.com/jekyll/minima

Author

(张春生), <zhangchunsheng423@gmail.com>

Profile of Chunsheng Zhang (张春生) on StackOverflow

Copyright & License

  • Code & Docs © 2014-now Chunsheng Zhang <zhangchunsheng423@gmail.com>
  • Code released under the Apache-2.0 License
  • Docs released under Creative Commons