Staticman with Gitlab

Use webhooks

Taken From Zong Ren’s blog

  1. Create a staticmanapp
  2. Create a trigger
  3. Create a webhook

Staticman is a very handy static blog commenting implementation, but unfortunately only supports github and jekyll, but using staticman on gitlab pages is possible by using the github webhooks and gitlab triggers features.

Create staticmanapp

The first step is to create staticman app, according to the official document operation, you can also view the repository I created.

Create a trigger

Select in the gitlab project menu Triggers > Add triggerand copy the link below

curl -X POST \
     -F token=TOKEN \
     -F ref=REF_NAME \

Create a webhook

Click on the github project Settings>Webhooks>Add webhook, Payload URL fill in the link above and add parameters, for example

Notice that the token is replaced

asarkar comment

The target of comment form is Zongren Comments ,so there will be not https issues. I only maintain my comments on github,and whenever there is a comment pushed to github repository by staticmanapp,it triggers gitlab to run page runner

Gitlab Clones

The key is gitlab clones from github comment repository

  - npm install hexo-cli -g -s
  - npm install -s
  - git clone ""
  - mv comment/_data source/
  - hexo clean --silent
  - hexo algolia --silent true --vscode false
  - hexo deploy --silent --vscode false
and uses them in theme file

And uses them in theme file

for(i in{
    var nameArray = i.split('/');
        var postName = nameArray[0];
            if(postName == slug){
     [i]["fileName"] = nameArray[1];

Staticman Issues

Or from: Staticman issue 22

zburgermeiszter commented on Feb 28, 2017 For this we should add the git provider domain to the request as a path element. so it would look like.


But because one can have it’s own GitLab on it’s own domain, we should also handle that. And GitLab Pages are now available on GitLab Community Edition

Required Node libs for future reference: gitlab gitlab-webhook

Add A Page Review

Add A Rating: 
Please Agree to Our Terms and Conditions  *