on master help sign in
build: move build styles from manage.sh to Makefile
e7fbefaMarkus Heiser
Makefile+25
@@ -128,6 +128,31 @@ themes.simple:
128 $(Q)echo '[!] Grunt build : simple theme'
128 $(Q)echo '[!] Grunt build : simple theme'
129 $(Q)PATH="$$(npm bin):$$PATH" grunt --gruntfile "searx/static/themes/simple/gruntfile.js"
129 $(Q)PATH="$$(npm bin):$$PATH" grunt --gruntfile "searx/static/themes/simple/gruntfile.js"
130
130
131+# build styles
132+# ------------
133+
134+PHONY += styles style.legacy style.courgette style.pixart style.bootstrap
135+styles: style.legacy style.courgette style.pixart style.bootstrap
136+
137+quiet_cmd_lessc = STYLE $3
138+ cmd_lessc = PATH="$$(npm bin):$$PATH" \
139+ lessc --clean-css="--s1 --advanced --compatibility=ie9" "searx/static/$2" "searx/static/$3"
140+
141+style.legacy:
142+ $(call cmd,lessc,themes/legacy/less/style-rtl.less,themes/legacy/css/style-rtl.css)
143+ $(call cmd,lessc,themes/legacy/less/style.less,themes/legacy/css/style.css)
144+
145+style.courgette:
146+ $(call cmd,lessc,themes/courgette/less/style.less,themes/courgette/css/style.css)
147+ $(call cmd,lessc,themes/courgette/less/style-rtl.less,themes/courgette/css/style-rtl.css)
148+
149+style.pixart:
150+ $(call cmd,lessc,themes/pix-art/less/style.less,themes/pix-art/css/style.css)
151+
152+style.bootstrap:
153+ $(call cmd,lessc,less/bootstrap/bootstrap.less,css/bootstrap.min.css)
154+
155+
131# docker
156# docker
132# ------
157# ------
133
158
manage.sh−22
@@ -130,27 +130,6 @@ npm_packages() {
130 npm install
130 npm install
131}
131}
132
132
133−build_style() {
134− npm_path_setup
135−
136− lessc --clean-css="--s1 --advanced --compatibility=ie9" "$BASE_DIR/searx/static/$1" "$BASE_DIR/searx/static/$2"
137−}
138−
139−styles() {
140− npm_path_setup
141−
142− echo '[!] Building legacy style'
143− build_style themes/legacy/less/style.less themes/legacy/css/style.css
144− build_style themes/legacy/less/style-rtl.less themes/legacy/css/style-rtl.css
145− echo '[!] Building courgette style'
146− build_style themes/courgette/less/style.less themes/courgette/css/style.css
147− build_style themes/courgette/less/style-rtl.less themes/courgette/css/style-rtl.css
148− echo '[!] Building pix-art style'
149− build_style themes/pix-art/less/style.less themes/pix-art/css/style.css
150− echo '[!] Building bootstrap style'
151− build_style less/bootstrap/bootstrap.less css/bootstrap.min.css
152−}
153−
154docker_build() {
133docker_build() {
155 # Check if it is a git repository
134 # Check if it is a git repository
156 if [ ! -d .git ]; then
135 if [ ! -d .git ]; then
@@ -241,7 +220,6 @@ Commands
241 Build
220 Build
242 -----
221 -----
243 locales - Compile locales
222 locales - Compile locales
244− styles - Build less files
245
223
246 Tests
224 Tests
247 -----
225 -----