-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
32 lines (27 loc) · 849 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# https://jekyllrb.com/docs/step-by-step/01-setup/
BUND=bundle
EXEC=$(BUND) exec
EXEC_IP="0.0.0.0"
EXEC_PORT=9444
LOG_FILE=jekyll.log
install:
sudo apt install ruby ruby-dev build-essential zlib1g zlib1g-dev zlib1g-dbg
#
if [ -z "$$GEM_HOME" ]; then \
echo '# Install Ruby Gems to ~/gems' >> ~/.bashrc; \
echo 'export GEM_HOME=$$HOME/gems' >> ~/.bashrc; \
echo 'export PATH=$$HOME/gems/bin:$$PATH' >> ~/.bashrc; \
source ~/.bashrc; \
fi
#
sudo gem install jekyll bundler
build: Gemfile
set -e # halt script on error
# 构建网站,输出到 _site 目录
$(EXEC) jekyll build
$(EXEC) htmlproofer ./_site --disable-external
update: Gemfile
$(BUND) update
test: Gemfile
# 每当文件发生变更时,重新构建
nohup $(EXEC) jekyll serve --host $(EXEC_IP) --port $(EXEC_PORT) &>$(LOG_FILE) &