-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
66 lines (56 loc) · 1.74 KB
/
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
.PHONY: dist test build
ENV_VERSION = 1.0.0
ENV_JEKYLL_VERSION ?= 3.8.7
ENV_JEKYLL_HOST ?= 0.0.0.0
ENV_JEKYLL_PORT ?= 54000
printInfo:
@echo "=> Script Info version $(ENV_VERSION)"
@echo ""
@echo "jekyll theme use https://github.com/kaeyleo/jekyll-theme-H2O"
@echo "jekyll version use as: $(ENV_JEKYLL_VERSION)"
@echo ""
installDev:
@echo "=> start install rake more: https://github.com/ruby/rake"
gem list rake
gem install rake
gem install bundler
gem install sass
gem install --user-install jekyll -v '${ENV_JEKYLL_VERSION}'
npm install uglifyjs-folder -g
init:
@echo "=> this project use rake more: https://github.com/ruby/rake"
@echo "-> if not install just run [make installDev]"
rake -V
bundle -v
install:
-@RM -r node_modules
$(info has clean node_modules)
-@RM -r package-lock.json
$(info has remove package-lock.json)
bundle install
debug:
bundle exec jekyll serve --host ${ENV_JEKYLL_HOST} --port ${ENV_JEKYLL_PORT}
build: install
bundle exec bundle exec jekyll build --baseurl /
uglifyjs:
uglifyjs-folder dev/js/ -o assets/js/index.min.js
minifySass:
@if [ -d .sass-cache ]; \
then rm -rf .sass-cache && echo "~> cleaned .sass-cache"; \
else echo "~> has cleaned .sass-cache"; \
fi
sass -v
sass --style compressed --sourcemap=none dev/sass/app.scss assets/css/app.min.css
minify: uglifyjs minifySass
@echo "minify success"
help: printInfo
@echo "Help of task"
@echo "make installDev ~> install debug mode need tools"
@echo "make init ~> init check"
@echo "make debug ~> run at http://${ENV_JEKYLL_HOST}:${ENV_JEKYLL_PORT}/"
@echo "make build ~> build at _site"
@echo ""
@echo "=> new file as"
@echo "rake post title='article name'"
@echo "=> new assets for image as:"
@echo "rake assetsFoder -g img"