on master help sign in
[fix] brands: add variables from build env to grunt process
757ebb5Markus Heiser
Makefile+15
@@ -28,6 +28,7 @@ help:
28 @echo ' gh-pages - build docs & deploy on gh-pages branch'
28 @echo ' gh-pages - build docs & deploy on gh-pages branch'
29 @echo ' clean - drop builds and environments'
29 @echo ' clean - drop builds and environments'
30 @echo ' project - re-build generic files of the searx project'
30 @echo ' project - re-build generic files of the searx project'
31+ @echo ' themes - re-build build the source of the themes'
31 @echo ''
32 @echo ''
32 @$(MAKE) -s -f utils/makefile.include make-help
33 @$(MAKE) -s -f utils/makefile.include make-help
33 @echo ''
34 @echo ''
@@ -87,6 +88,20 @@ searx.brand:
87 $(Q)echo "DOCS_URL = '$(DOCS_URL)'" >> searx/brand.py
88 $(Q)echo "DOCS_URL = '$(DOCS_URL)'" >> searx/brand.py
88 $(Q)echo "PUBLIC_INSTANCES = 'https://searx.space'" >> searx/brand.py
89 $(Q)echo "PUBLIC_INSTANCES = 'https://searx.space'" >> searx/brand.py
89
90
91+# build themes
92+# ------------
93+
94+PHONY += themes themes.oscar themes.simple
95+themes: themes.oscar themes.simple
96+
97+themes.oscar:
98+ $(Q)echo '[!] Grunt build : oscar theme'
99+ $(Q)grunt --gruntfile "searx/static/themes/oscar/gruntfile.js"
100+
101+themes.simple:
102+ $(Q)echo '[!] Grunt build : simple theme'
103+ $(Q)grunt --gruntfile "searx/static/themes/simple/gruntfile.js"
104+
90# test
105# test
91# ----
106# ----
92
107
docs/dev/quickstart.rst+3−3
@@ -87,8 +87,8 @@ After satisfying the requirements styles can be build using ``manage.sh``
87 ./manage.sh styles
87 ./manage.sh styles
88
88
89
89
90−How to build the source of the oscar theme
90+How to build the source of the themes
91−==========================================
91+=====================================
92
92
93.. _grunt: https://gruntjs.com/
93.. _grunt: https://gruntjs.com/
94
94
@@ -104,7 +104,7 @@ After installing grunt, the files can be built using the following command:
104
104
105.. code:: sh
105.. code:: sh
106
106
107− ./manage.sh grunt_build
107+ make themes
108
108
109
109
110Tips for debugging/development
110Tips for debugging/development
manage.sh−10
@@ -156,15 +156,6 @@ styles() {
156 build_style less/bootstrap/bootstrap.less css/bootstrap.min.css
156 build_style less/bootstrap/bootstrap.less css/bootstrap.min.css
157}
157}
158
158
159−grunt_build() {
160− npm_path_setup
161−
162− echo '[!] Grunt build : oscar theme'
163− grunt --gruntfile "$SEARX_DIR/static/themes/oscar/gruntfile.js"
164− echo '[!] Grunt build : simple theme'
165− grunt --gruntfile "$SEARX_DIR/static/themes/simple/gruntfile.js"
166−}
167−
168docker_build() {
159docker_build() {
169 # Check if it is a git repository
160 # Check if it is a git repository
170 if [ ! -d .git ]; then
161 if [ ! -d .git ]; then
@@ -257,7 +248,6 @@ Commands
257 -----
248 -----
258 locales - Compile locales
249 locales - Compile locales
259 styles - Build less files
250 styles - Build less files
260− grunt_build - Build files for themes
261 docker_build - Build Docker image
251 docker_build - Build Docker image
262
252
263 Tests
253 Tests
searx/static/themes/oscar/gruntfile.js+1−3
@@ -13,7 +13,7 @@ module.exports = function(grunt) {
13 },
13 },
14 uglify: {
14 uglify: {
15 options: {
15 options: {
16− banner: '/*! oscar/searx.min.js | <%= grunt.template.today("dd-mm-yyyy") %> | https://github.com/asciimoo/searx */\n'
16+ banner: '/*! oscar/searx.min.js | <%= grunt.template.today("dd-mm-yyyy") %> | <%= process.env.GIT_URL %> */\n'
17 },
17 },
18 dist: {
18 dist: {
19 files: {
19 files: {
@@ -38,7 +38,6 @@ module.exports = function(grunt) {
38 development: {
38 development: {
39 options: {
39 options: {
40 paths: ["less/pointhi", "less/logicodev", "less/logicodev-dark"]
40 paths: ["less/pointhi", "less/logicodev", "less/logicodev-dark"]
41− //banner: '/*! less/oscar/oscar.css | <%= grunt.template.today("dd-mm-yyyy") %> | https://github.com/asciimoo/searx */\n'
42 },
41 },
43 files: {"css/pointhi.css": "less/pointhi/oscar.less",
42 files: {"css/pointhi.css": "less/pointhi/oscar.less",
44 "css/logicodev.css": "less/logicodev-dark/oscar.less",
43 "css/logicodev.css": "less/logicodev-dark/oscar.less",
@@ -47,7 +46,6 @@ module.exports = function(grunt) {
47 production: {
46 production: {
48 options: {
47 options: {
49 paths: ["less/pointhi", "less/logicodev", "less/logicodev-dark"],
48 paths: ["less/pointhi", "less/logicodev", "less/logicodev-dark"],
50− //banner: '/*! less/oscar/oscar.css | <%= grunt.template.today("dd-mm-yyyy") %> | https://github.com/asciimoo/searx */\n',
51 cleancss: true
49 cleancss: true
52 },
50 },
53 files: {"css/pointhi.min.css": "less/pointhi/oscar.less",
51 files: {"css/pointhi.min.css": "less/pointhi/oscar.less",
searx/static/themes/simple/gruntfile.js+3−3
@@ -36,7 +36,7 @@ module.exports = function(grunt) {
36 },
36 },
37 uglify: {
37 uglify: {
38 options: {
38 options: {
39− banner: '/*! simple/searx.min.js | <%= grunt.template.today("dd-mm-yyyy") %> | https://github.com/asciimoo/searx */\n',
39+ banner: '/*! simple/searx.min.js | <%= grunt.template.today("dd-mm-yyyy") %> | <%= process.env.GIT_URL %> */\n',
40 output: {
40 output: {
41 comments: 'some'
41 comments: 'some'
42 },
42 },
@@ -57,7 +57,7 @@ module.exports = function(grunt) {
57 development: {
57 development: {
58 options: {
58 options: {
59 paths: ["less"],
59 paths: ["less"],
60− banner: '/*! searx | <%= grunt.template.today("dd-mm-yyyy") %> | https://github.com/asciimoo/searx */\n'
60+ banner: '/*! searx | <%= grunt.template.today("dd-mm-yyyy") %> | <%= process.env.GIT_URL %> */\n'
61 },
61 },
62 files: {
62 files: {
63 "css/searx.css": "less/style.less",
63 "css/searx.css": "less/style.less",
@@ -73,7 +73,7 @@ module.exports = function(grunt) {
73 compatibility: '*'
73 compatibility: '*'
74 })
74 })
75 ],
75 ],
76− banner: '/*! searx | <%= grunt.template.today("dd-mm-yyyy") %> | https://github.com/asciimoo/searx */\n'
76+ banner: '/*! searx | <%= grunt.template.today("dd-mm-yyyy") %> | <%= process.env.GIT_URL %> */\n'
77 },
77 },
78 files: {
78 files: {
79 "css/searx.min.css": "less/style.less",
79 "css/searx.min.css": "less/style.less",