For people who love to write things, it is very important to choose the right blogging platform. As Web developers, we would love to have a highly customized blogging platform to showcase our unique personalities and record our learning and work over the years. At the same time, we also hope that this platform will allow us to easily publish content, complete with likes, comments and so on. After a series of attempts, such as Hexo, WordPress and self-built services, I finally chose Github Issues as my blog platform.

Basic blogging skills

For a qualified blogging platform, it mainly provides the following capabilities:

  1. Profile for a personal blog, it first supports the presentation of the blogger’s profile. This profile may include a profile picture, a nickname, contact information, etc., to give the reader a basic idea of the owner of the blog.

  2. Writing and Presenting The most important thing about a blog is its content, the articles in it. A good blogging platform should have the ability to write articles easily, so that users can write and edit their own articles without any burden. In addition, you must be able to provide information about the article, such as showing title, excerpt, cover, creation/revision date, number of comments like, etc.

  3. Archiving ability An article writing time, content label/classification are different, how to archive these articles according to different requirements, is also one of the ability of the blog platform. In addition, adding a search function can greatly facilitate readers’ browsing of blogs when there are a large number of articles.

  4. The ability of bloggers to interact with readers alone may not inspire the motivation of writing. If blogs can provide the ability of bloggers to interact with readers, it will effectively motivate bloggers to continue to create and promote the spread of articles. The function of likes and comments is one of the most important functions of interactive ability.

After the above points, we can basically know a blog platform, its main function is “to show themselves, communicate with the outside world”. On the premise of satisfying this foundation, it should also be easy to operate and highly customized.

Why not choose another option

At the beginning of this article, I mentioned that I have tried to maintain a blog through WordPress, Hexo, and self-built services. But the results of these attempts are not to my liking, and finally nothing. Ultimately, it’s just not free or convenient enough.

For example, WordPress and Hexo both have the ability to create beautifully themed, fully functional blogs, but only within the rules they set. If I wanted to DIY a theme, or add any new ability I wanted, I had to wade through their documentation, find the rules and try to implement them, dancing in shackles. In addition, to publish new articles, it is often very inelegant to run the command line locally. What’s more, if you want to add a comment function for the article, but also a lot of trouble, surely experienced people know.

As for self-built services, it can be described as both free and convenient, want any function can be realized by themselves. However, the biggest disadvantage of this scheme is the high cost. For the human cost, server database configuration, domain name, record and a series of operations are very annoying, even consider alarms, load, downtime and a bunch of other operations and maintenance issues. Toss over much, also have no idea to write an article inside. For the cost of money, buy a domain name, buy a server is also a cost, especially when we have a period of time when the output of the article is particularly little, always feel that a server for nothing…

Select lot issues

Github first, then Issues.

As the world’s largest code hosting platform, and just acquired by Microsoft, its reliability is very high, and there is no need to worry about the loss of data stored inside (think netease blog, Baidu Post bar, etc.).

Github allows you to carefully edit your profile picture, nickname, email address, employer, and more.

Github Issues offers quick and easy editing capabilities, especially textures. It supports drag and drop, paste, select the way to upload pictures, images are stored in this place, user-images.githubusercontent.com and support chain – it also means that we can easily copy the contents of the issue to other platforms.

In Github Issues, you can add interactive Labels such as likes and love to an issue, set Labels to Categories, and add Comment to an issue.

Most importantly, Github provides an API that meets most of the requirements, including calls to REST and GraphQL. This is what makes Github a great blogging platform for us, as we’ll explain in more detail.

It is not hard to see that Github Issues has all the capabilities of a blogging platform mentioned above. Next, we will take Github Issues as the management back-end of the blog platform, and use API to realize data interaction with the client.

Natural separation of the front and back ends

For more information about Github API licensing and debugging, check out my article “Github API-based Map Bed Chrome Plugin Development record.”

We use Github Issues as the blogging platform, which is sort of the admin backend. We write articles in the admin back end, set tags, reply to comments, and then pass the data to the client through API calls.

Some of the more commonly used V3 apis are as follows:

  • Obtain the login user information (GET) api.github.com/user

  • To obtain a list of the warehouse issues (GET) api.github.com/repos/:owne…

  • To obtain a list of a particular issue comments (GET) api.github.com/repos/:owne…

  • Access to a particular issue of thumb up and red hearts reactions (GET) api.github.com/repos/:owne…

  • For a particular issue to submit a comment (POST) api.github.com/repos/:owne…

    Name Type Description
    body string Required. The contents of the comment.
  • Add a reaction to a particular issue (POST) api.github.com/repos/:owne…

    Name Type Description
    content string Required. The reaction type to add to the issue.

Of course, you can also use v4 GraphQL interface, is also very convenient, interested in their own research.

While the back-end uses the ready-made Github Issues page, the client uses Github Pages, a free static page deployment service provided by Github for developers. To use this service, just open a repository, go to Github Pages in the repository Settings and open it. By default, the root directory of the Master branch is used as the static resource directory.

When you open Github Pages, you can access the blog directly from the browser via its URL, and the blog data is loaded entirely from the Github API.

Through an authorized interface, it also allows you to submit comments and other functions:

conclusion

To sum up, Github Issues provides the basic capabilities required by a blogging platform, combined with Github’s reliability, comprehensive API, and convenience of Github Pages. My personal blog based on Github Issues has also been launched, welcome to experience:

jrainlau.github.io/#/

If you feel good about it, please set up a blog based on Github Issues and look forward to communicating with you!