Chinese version: 使用windows部署hexo+gitlab pages环境
Go to Git official website to download windows and install it.
Go to NodeJs official website to download the windows version and install it.
Go to Gitlab official website to register.
Create a new blog folder, go to the folder, right click, and select
git bash here.
Enter the command to install Hexo:
npm install --save hexo-renderer-jade hexo-generator-feed hexo-generator-sitemap hexo-browsersync hexo-generator-archive hexo-renderer-pug hexo-renderer-stylus
Enter the command to install Hexo: After the completion, enter the command to initialize Hexo:
hexo init hexo
Go to the hexo directory and install dependencies:
Enter hexo clean to test whether hexo is in normal use:
Not surprisingly, you will get the following:
INFO Validating config
The following uses the butterfly theme as an example
git clone -b master https://github.com/jerryc127/hexo-theme-butterfly.git themes/butterfly
Change the theme used
_config.yml in the hexo root folder
theme: landscape to
hexo g ; hexo d
view your blog
Then return to the git program
Log in to Gitlab and click New project.
Create blank project
Project name fill in
Visibility Level select
Go to settings/repository
Open Protected branches
Change it to the following option
Return to the git program in the previous step
Delete the themes/butterfly/.git folder
(If you have a bank card for verification, please ignore this step)
Enter settings ci/cd
Open powershell as administrator
New-Item -Path 'C:\GitLab-Runner' -ItemType Directory
Invoke-WebRequest -Uri "https://gitlab-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-runner-windows-amd64.exe" -OutFile "gitlab-runner.exe"
and wait for it to complete
token Fill in the registration token given in the link opened in the previous step
For the remaining three steps, press Enter three times
Enter an executor Enter
shell = "pwsh" to
shell = "powershell"
then save and exit
Return to the powershell window opened in the previous step
Return to the page opened in the previous step
Enable shared runners for this project
change to gray
Click the plus sign to create a new file named
Fill in the content:
Visit %yourname%.gitlab.io to view your deployed blog
- 1. This article was translated by the Chinese version using Google Translate
- 2. Preparation
- 3. deploy blog