For people who love writing, it is very important to choose a suitable blog platform. As a Web developer, we certainly hope to have a highly customized blog platform to show our unique personality and record our long-term learning work. At the same time, we also hope that this platform can make it easy for us to publish content and provide complete comments, messages and other operations. After a series of attempts such as Hexo, WordPress and self-built services, I finally chose Github issues as my blog platform.
Basic Ability of Blog
For a qualified blog platform, it mainly provides the following capabilities:
- Personal introduction
For personal blogs, it must first support the presentation of the blogger’s personal introduction. This personal introduction may include basic contents such as avatar, nickname, contact information, etc. It can enable readers to have a basic understanding of the owner of this blog.
- Writing and Displaying Articles
For a blog, the most important thing is its content, that is, the articles in it. A good blog platform should have the ability to write articles conveniently so that users can write and edit their own articles without any burden. In addition, it is also necessary to be able to provide information about the article, such as display title, excerpt, cover, creation/modification time, comments, etc.
- Archiving capacity
The writing time, content label/classification, etc. of an article are different. How to archive these articles according to different requirements is also one of the capabilities of the blog platform. Moreover, when the number of articles is large, adding a search function can also greatly facilitate readers to browse blogs.
- Ability of Bloggers to Interact with Readers
It may be difficult for a blogger to motivate writing if he or she is the only one. If a blog can provide the blogger with the ability to interact with readers, it will effectively encourage the blogger to create continuously and improve the dissemination of articles. Praise and comment functions are one of the most important functions in the interactive ability.
Through the above points, we can basically know a blog platform whose main function is to “show yourself and communicate with the outside world”. On the premise of satisfying this foundation, it should also have the characteristics of convenient operation and high customization.
Why not choose another plan
At the beginning of the article, I mentioned that I have tried to use WordPress, Hexo, self-built services and other ways to try to maintain the blog. However, the results of these attempts were not to my liking and ended without any problems. In the final analysis, it is not free and convenient enough.
For example, WordPress and Hexo both have the ability to build a blog with beautiful themes and full functions, but these must be carried out under the rules they set. If I want to DIY a theme, or add any new abilities I want, I must go through their documents carefully, find the corresponding rules, and then try to implement them. It can be said to be dancing in chains. In addition, to publish new articles, one has to run the command line locally, which is really not elegant. What’s more, if you want to add a comment function to the article, you will have to go through a lot of trouble. I think everyone who has experienced it will understand.
As for self-built service, it can be said that it is both free and convenient. Any function you want can be realized by yourself. However, the biggest disadvantage of this scheme is its high cost. For the labor cost, a series of operations such as server database configuration, domain name, filing, etc. are very annoying, and even a lot of operation and maintenance problems such as alarm, load, downtime, etc. have to be considered. After much trouble, I didn’t have much idea to write articles in it. For money costs, buying domain names and servers is also an expense, especially when we have a particularly low output of articles for a certain period of time, we always feel that we have a server for nothing.
Select Github issues
Github first, then issues.
As the world’s largest code hosting platform, and just under Microsoft’s revenue, its reliability is very high, basically don’t have to worry about the data stored in it will be lost (think about the domestic netease blog, Baidu post bar, etc.).
On Github, we can carefully edit our account information, including avatar, nickname, email, work unit, etc.
Github issues provides very convenient editing capabilities, especially maps. It supports uploading pictures by dragging, pasting and selecting, and the pictures will be stored inhttps://user-images.githubuse …This place also supports external links-this also means that we can easily transfer the issue content to other platforms.
In Github issues, you can add interactive tags (Reactions) such as praise and love to a certain issue, set classification tags, and even add Comment to the issue.
The most important thing is that Github provides a set of API that meets most of the requirements, including REST and GraphQL calling methods. This is what Github can become the killer of our blog platform. This will be explained in detail later.
It is not difficult to see that Github issues has all the capabilities that a blog platform mentioned above should have. Next, we will use Github issues as the management back-end of the blog platform and use API to realize data interaction with the client.
Natural separation of anterior and posterior ends
For authorization and debugging of Github API, please refer to another article of mine.“Github API-based Chrome Plug-in Development Record for Picture Bed”.
We use Github issues as a blog platform, which is equivalent to managing the backend. We write articles in the management backend, set tags, reply comments, and then send the data to the client through API calls.
Several commonly used v3 API are as follows:
- GET login user information (get)
- Gets the issues list (GET) of the warehouse
- GET a comment list (get) for an issue
- Get the responses (get) of a certain issue such as praise and hearts
Submit a POST for an issue
Name Type Description body string Required. The contents of the comment.
Add a reaction(POST) to an issue
Name Type Description content string Required. The reaction type to add to the issue.
Of course, you can also use v4′ s GraphQL interface, which is also very convenient. those who are interested can do their own research.
The management back-end uses the existing Github issues pages directly, and the client uses Github Pages, a static page deployment service provided free of charge by GitHub for developers. To use this service, you only need to open a warehouse, then find Github pages in the warehouse’s Settings and open it. by default, the root directory of the Master branch will be used as the static resource directory. all we need to do is place the static resource of the client directly here.
After Github pages is opened, the blog can be accessed directly in the browser through the URL provided by GitHub Pages, and the data of the blog is completely loaded from Github API.
Through the authorized interface, it is also allowed to submit comments and other functions:
To sum up, Github issues provides all the basic capabilities required for a blog platform, and is very suitable to be used as a blog platform in combination with Github reliability, API comprehensiveness and Github pages convenience. My Github issues-based personal blog has also been launched. Welcome to experience:
If you think it’s good too, set up a Github issues-based blog for yourself and look forward to communicating with you!