banner
月落星河Tsukistar

月落星河Tsukistar

浩瀚中的伟大,孤独间的渺小
github
twitter
youtube
bilibili
email

Experience of setting up Gridea client

I can't let my Github Pages idle, after all, it should be possible to put some technical articles on it, which can also serve as notes for finding solutions to similar problems in the future.
Someone in the group recommended Gridea to create a static blog, so I searched for it and downloaded the client. It is indeed simple and convenient to write articles, and I am quite satisfied with the theme. So I started trying to connect it to my Github Page.

Remote Connection and Synchronization#

The configuration part has corresponding tutorials on the official website, so I won't go into details here. After filling in all the information, it showed that remote connection was not possible. No matter how I checked the repository name, username, or changed the token, it didn't work. After searching for various solutions, I opened Edit -> Developer Tools -> Console and found the error code "spawn git ENOENT ... at Process.ChildProces...ickCallbak". The solution is to edit the Path item in the environment variables, create two new entries, each containing the bin directory and git-core directory of Git installed on your computer, as shown in the figure below:
Edit environment variables
After configuring this, restart the Gridea client and you will be able to connect remotely successfully.
Later, there was a problem with synchronization, showing synchronization failure. Please refer to the FAQ or contact the author for help (fortunately, there is a help interface now, and the error that occurred during remote connection is mentioned in it, but there is no prompt to guide me where to look). Similarly, open "Edit -> Developer Tools -> Console", and the displayed exception is shown in the figure below:
Console exception
Double-click on "message" to see all error messages, just copy and paste them (you can even copy them to Google Translate for better understanding):
Detailed information
The problem I encountered here was that my email was private, which prevented the git command from being executed correctly. After setting it in Github, the synchronization was successful and the word "synchronization successful" appeared.
Synchronization successful
At this point, the basic functions have been implemented.

Configuration of gitalk comment system#

I wanted to introduce a comment system in my blog, so I chose the Gitalk comment plugin. Gridea only requires us to provide four necessary things to add gitalk comments to the site. We need to fill in Client ID, Client Secret, repository, and owner. Among them, Client ID and Client Secret need to be applied for OAuth App. The steps are as follows:
① Click on your avatar in the upper right corner of Github and click "Settings"
Click on Settings
② Click on "Developer settings", then click on "OAuth Apps" -> "New OAuth Apps"
Create OAuth Apps
③ After arriving at this page, fill in the Application name randomly, fill in the Homepage URL with the link of the Github Page repository (https://github.com/username/repository... and so on), the Application description can be left blank, and fill in the Authorization callback URL with the domain name of your Github Page (distinguish between http and https)
Fill in information
④ After completing, copy the Client ID and Client Secret to the client, fill in the repository and owner, and you can use the gitalk comment plugin!

If using Coding Pages#

Based on personal experience, Coding Pages is indeed much better than Github Pages.
For registration and configuration, please refer to the official tutorial.
For the gitalk part, there are two parts that need to be modified in the OAuth App. One is the Homepage URL, you can create a repository randomly and fill in the address of the repository, and the other is the Authorization callback URL, which needs to be filled with the domain name of your Coding Pages (distinguish between http and https). Then in Gridea, fill in the repository column with the repository name used in your OAuth App, and fill in the owner with the username of the Github account used to create the repository.

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.