Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(build): add a script to build the docs #484

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/public
/resources
/node_modules

.vscode
/public
/resources
/node_modules

.vscode
hugo.exe
/hugo
70 changes: 70 additions & 0 deletions build.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
@echo off
setlocal enabledelayedexpansion

:check_go
where go >nul 2>nul
if %errorlevel% neq 0 (
echo GO is not installed. Please install Go and try again.
exit /b 1
)
goto :check_gcc

:check_gcc
where gcc >nul 2>nul
if %errorlevel% neq 0 (
echo GCC is not installed. Please install GCC and try again.
exit /b 1
)
goto :check_hugo

:check_hugo
where hugo >nul 2>nul
if %errorlevel% equ 0 (
echo Hugo is already installed. Starting Hugo server...
hugo server --disableFastRender
exit /b 0
)
goto :clone_and_build_hugo

:clone_and_build_hugo
echo Hugo not found. Cloning and building Hugo...

git clone https://github.com/blattersturm/hugo.git
if %errorlevel% neq 0 (
echo Failed to clone Hugo repository.
exit /b 1
)

cd hugo
if %errorlevel% neq 0 (
echo Failed to change directory to Hugo.
exit /b 1
)

git switch processed-content-variable
if %errorlevel% neq 0 (
echo Failed to switch branch.
exit /b 1
)

go env -w CGO_ENABLED=1

go install --tags extended
if %errorlevel% neq 0 (
echo Failed to install Hugo.
exit /b 1
)

go build --tags extended
if %errorlevel% neq 0 (
echo Failed to build Hugo.
exit /b 1
)

echo Hugo has been successfully built.
echo Starting Hugo server...
hugo server --disableFastRender

exit /b 0

:end