mirror of
https://github.com/searxng/searxng.git
synced 2024-11-17 18:00:12 +01:00
[fix] brands: add variables from build env to grunt process
We have some variables in the build environment which are also needed in the grunt process when building themes. Theses variables are relavant if one creates a fork with its own branding. We treat these variables under the term 'brands'. Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This commit is contained in:
parent
aaf22baad2
commit
757ebb5d9f
15
Makefile
15
Makefile
@ -28,6 +28,7 @@ help:
|
|||||||
@echo ' gh-pages - build docs & deploy on gh-pages branch'
|
@echo ' gh-pages - build docs & deploy on gh-pages branch'
|
||||||
@echo ' clean - drop builds and environments'
|
@echo ' clean - drop builds and environments'
|
||||||
@echo ' project - re-build generic files of the searx project'
|
@echo ' project - re-build generic files of the searx project'
|
||||||
|
@echo ' themes - re-build build the source of the themes'
|
||||||
@echo ''
|
@echo ''
|
||||||
@$(MAKE) -s -f utils/makefile.include make-help
|
@$(MAKE) -s -f utils/makefile.include make-help
|
||||||
@echo ''
|
@echo ''
|
||||||
@ -87,6 +88,20 @@ searx.brand:
|
|||||||
$(Q)echo "DOCS_URL = '$(DOCS_URL)'" >> searx/brand.py
|
$(Q)echo "DOCS_URL = '$(DOCS_URL)'" >> searx/brand.py
|
||||||
$(Q)echo "PUBLIC_INSTANCES = 'https://searx.space'" >> searx/brand.py
|
$(Q)echo "PUBLIC_INSTANCES = 'https://searx.space'" >> searx/brand.py
|
||||||
|
|
||||||
|
# build themes
|
||||||
|
# ------------
|
||||||
|
|
||||||
|
PHONY += themes themes.oscar themes.simple
|
||||||
|
themes: themes.oscar themes.simple
|
||||||
|
|
||||||
|
themes.oscar:
|
||||||
|
$(Q)echo '[!] Grunt build : oscar theme'
|
||||||
|
$(Q)grunt --gruntfile "searx/static/themes/oscar/gruntfile.js"
|
||||||
|
|
||||||
|
themes.simple:
|
||||||
|
$(Q)echo '[!] Grunt build : simple theme'
|
||||||
|
$(Q)grunt --gruntfile "searx/static/themes/simple/gruntfile.js"
|
||||||
|
|
||||||
# test
|
# test
|
||||||
# ----
|
# ----
|
||||||
|
|
||||||
|
@ -87,8 +87,8 @@ After satisfying the requirements styles can be build using ``manage.sh``
|
|||||||
./manage.sh styles
|
./manage.sh styles
|
||||||
|
|
||||||
|
|
||||||
How to build the source of the oscar theme
|
How to build the source of the themes
|
||||||
==========================================
|
=====================================
|
||||||
|
|
||||||
.. _grunt: https://gruntjs.com/
|
.. _grunt: https://gruntjs.com/
|
||||||
|
|
||||||
@ -104,7 +104,7 @@ After installing grunt, the files can be built using the following command:
|
|||||||
|
|
||||||
.. code:: sh
|
.. code:: sh
|
||||||
|
|
||||||
./manage.sh grunt_build
|
make themes
|
||||||
|
|
||||||
|
|
||||||
Tips for debugging/development
|
Tips for debugging/development
|
||||||
|
10
manage.sh
10
manage.sh
@ -156,15 +156,6 @@ styles() {
|
|||||||
build_style less/bootstrap/bootstrap.less css/bootstrap.min.css
|
build_style less/bootstrap/bootstrap.less css/bootstrap.min.css
|
||||||
}
|
}
|
||||||
|
|
||||||
grunt_build() {
|
|
||||||
npm_path_setup
|
|
||||||
|
|
||||||
echo '[!] Grunt build : oscar theme'
|
|
||||||
grunt --gruntfile "$SEARX_DIR/static/themes/oscar/gruntfile.js"
|
|
||||||
echo '[!] Grunt build : simple theme'
|
|
||||||
grunt --gruntfile "$SEARX_DIR/static/themes/simple/gruntfile.js"
|
|
||||||
}
|
|
||||||
|
|
||||||
docker_build() {
|
docker_build() {
|
||||||
# Check if it is a git repository
|
# Check if it is a git repository
|
||||||
if [ ! -d .git ]; then
|
if [ ! -d .git ]; then
|
||||||
@ -257,7 +248,6 @@ Commands
|
|||||||
-----
|
-----
|
||||||
locales - Compile locales
|
locales - Compile locales
|
||||||
styles - Build less files
|
styles - Build less files
|
||||||
grunt_build - Build files for themes
|
|
||||||
docker_build - Build Docker image
|
docker_build - Build Docker image
|
||||||
|
|
||||||
Tests
|
Tests
|
||||||
|
@ -13,7 +13,7 @@ module.exports = function(grunt) {
|
|||||||
},
|
},
|
||||||
uglify: {
|
uglify: {
|
||||||
options: {
|
options: {
|
||||||
banner: '/*! oscar/searx.min.js | <%= grunt.template.today("dd-mm-yyyy") %> | https://github.com/asciimoo/searx */\n'
|
banner: '/*! oscar/searx.min.js | <%= grunt.template.today("dd-mm-yyyy") %> | <%= process.env.GIT_URL %> */\n'
|
||||||
},
|
},
|
||||||
dist: {
|
dist: {
|
||||||
files: {
|
files: {
|
||||||
@ -38,7 +38,6 @@ module.exports = function(grunt) {
|
|||||||
development: {
|
development: {
|
||||||
options: {
|
options: {
|
||||||
paths: ["less/pointhi", "less/logicodev", "less/logicodev-dark"]
|
paths: ["less/pointhi", "less/logicodev", "less/logicodev-dark"]
|
||||||
//banner: '/*! less/oscar/oscar.css | <%= grunt.template.today("dd-mm-yyyy") %> | https://github.com/asciimoo/searx */\n'
|
|
||||||
},
|
},
|
||||||
files: {"css/pointhi.css": "less/pointhi/oscar.less",
|
files: {"css/pointhi.css": "less/pointhi/oscar.less",
|
||||||
"css/logicodev.css": "less/logicodev-dark/oscar.less",
|
"css/logicodev.css": "less/logicodev-dark/oscar.less",
|
||||||
@ -47,7 +46,6 @@ module.exports = function(grunt) {
|
|||||||
production: {
|
production: {
|
||||||
options: {
|
options: {
|
||||||
paths: ["less/pointhi", "less/logicodev", "less/logicodev-dark"],
|
paths: ["less/pointhi", "less/logicodev", "less/logicodev-dark"],
|
||||||
//banner: '/*! less/oscar/oscar.css | <%= grunt.template.today("dd-mm-yyyy") %> | https://github.com/asciimoo/searx */\n',
|
|
||||||
cleancss: true
|
cleancss: true
|
||||||
},
|
},
|
||||||
files: {"css/pointhi.min.css": "less/pointhi/oscar.less",
|
files: {"css/pointhi.min.css": "less/pointhi/oscar.less",
|
||||||
|
@ -36,7 +36,7 @@ module.exports = function(grunt) {
|
|||||||
},
|
},
|
||||||
uglify: {
|
uglify: {
|
||||||
options: {
|
options: {
|
||||||
banner: '/*! simple/searx.min.js | <%= grunt.template.today("dd-mm-yyyy") %> | https://github.com/asciimoo/searx */\n',
|
banner: '/*! simple/searx.min.js | <%= grunt.template.today("dd-mm-yyyy") %> | <%= process.env.GIT_URL %> */\n',
|
||||||
output: {
|
output: {
|
||||||
comments: 'some'
|
comments: 'some'
|
||||||
},
|
},
|
||||||
@ -57,7 +57,7 @@ module.exports = function(grunt) {
|
|||||||
development: {
|
development: {
|
||||||
options: {
|
options: {
|
||||||
paths: ["less"],
|
paths: ["less"],
|
||||||
banner: '/*! searx | <%= grunt.template.today("dd-mm-yyyy") %> | https://github.com/asciimoo/searx */\n'
|
banner: '/*! searx | <%= grunt.template.today("dd-mm-yyyy") %> | <%= process.env.GIT_URL %> */\n'
|
||||||
},
|
},
|
||||||
files: {
|
files: {
|
||||||
"css/searx.css": "less/style.less",
|
"css/searx.css": "less/style.less",
|
||||||
@ -73,7 +73,7 @@ module.exports = function(grunt) {
|
|||||||
compatibility: '*'
|
compatibility: '*'
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
banner: '/*! searx | <%= grunt.template.today("dd-mm-yyyy") %> | https://github.com/asciimoo/searx */\n'
|
banner: '/*! searx | <%= grunt.template.today("dd-mm-yyyy") %> | <%= process.env.GIT_URL %> */\n'
|
||||||
},
|
},
|
||||||
files: {
|
files: {
|
||||||
"css/searx.min.css": "less/style.less",
|
"css/searx.min.css": "less/style.less",
|
||||||
|
Loading…
Reference in New Issue
Block a user