From 6b80c57a3c04d6be37ae3c880f7e269fc362b107 Mon Sep 17 00:00:00 2001 From: Alexandre Flament Date: Wed, 16 Jun 2021 09:28:45 +0200 Subject: [mod] simple theme: move source files to the src directory --- searx/static/themes/simple/gruntfile.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'searx/static/themes/simple/gruntfile.js') diff --git a/searx/static/themes/simple/gruntfile.js b/searx/static/themes/simple/gruntfile.js index 4c14116b2..e1b44aa72 100644 --- a/searx/static/themes/simple/gruntfile.js +++ b/searx/static/themes/simple/gruntfile.js @@ -6,12 +6,12 @@ module.exports = function(grunt) { pkg: grunt.file.readJSON('package.json'), watch: { scripts: { - files: ['<%= jshint.files %>', 'less/*.less'], + files: ['src/**'], tasks: ['jshint', 'concat', 'uglify', 'webfont', 'less:development', 'less:production'] } }, jshint: { - files: ['js/searx_src/*.js', 'js/searx_header/*.js', '../__common__/js/*.js'], + files: ['src/js/main/*.js', 'src/js/head/*.js', '../__common__/js/*.js'], options: { reporterOutput: "", proto: true, @@ -29,8 +29,8 @@ module.exports = function(grunt) { separator: ';' }, files: { - 'js/searx.head.js': ['js/searx_head/*.js'], - 'js/searx.js': ['js/searx_src/*.js', '../__common__/js/*.js'] + 'js/searx.head.js': ['src/js/head/*.js'], + 'js/searx.js': ['src/js/main/*.js', '../__common__/js/*.js', 'js/autocomplete.js'] } } }, @@ -60,8 +60,8 @@ module.exports = function(grunt) { banner: '/*! searx | <%= grunt.template.today("dd-mm-yyyy") %> | <%= process.env.GIT_URL %> */\n' }, files: { - "css/searx.css": "less/style.less", - "css/searx-rtl.css": "less/style-rtl.less" + "css/searx.css": "src/less/style.less", + "css/searx-rtl.css": "src/less/style-rtl.less" } }, production: { @@ -77,8 +77,8 @@ module.exports = function(grunt) { banner: '/*! searx | <%= grunt.template.today("dd-mm-yyyy") %> | <%= process.env.GIT_URL %> */\n' }, files: { - "css/searx.min.css": "less/style.less", - "css/searx-rtl.min.css": "less/style-rtl.less" + "css/searx.min.css": "src/less/style.less", + "css/searx-rtl.min.css": "src/less/style-rtl.less" } }, }, -- cgit v1.2.3 From 6288b549e268e7e82a3f20278642343656ec2fc1 Mon Sep 17 00:00:00 2001 From: Alexandre Flament Date: Wed, 16 Jun 2021 10:37:06 +0200 Subject: [mod] simple theme: move magnet.svg to src/fonts see https://github.com/searx/searx/pull/1109 --- searx/static/themes/simple/gruntfile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'searx/static/themes/simple/gruntfile.js') diff --git a/searx/static/themes/simple/gruntfile.js b/searx/static/themes/simple/gruntfile.js index e1b44aa72..d4af12e65 100644 --- a/searx/static/themes/simple/gruntfile.js +++ b/searx/static/themes/simple/gruntfile.js @@ -107,7 +107,7 @@ module.exports = function(grunt) { 'node_modules/ionicons-npm/src/music-note.svg', 'node_modules/ionicons-npm/src/ion-close-round.svg', 'node_modules/ionicons-npm/src/android-more-vertical.svg', - 'magnet.svg', + 'src/fonts/magnet.svg', 'node_modules/ionicons-npm/src/android-close.svg', ], dest: 'fonts', -- cgit v1.2.3 From b4a47cacd8f9471fea9fb4099ad647a69169db5c Mon Sep 17 00:00:00 2001 From: Alexandre Flament Date: Wed, 16 Jun 2021 10:31:11 +0200 Subject: [mod] simple theme: leaflet becomes a packages.json dependency the build of the themes updates: * js/leaflet.js ( was leaflet/leaflet.js ) * css/leaflet.css ( was leaflet/leaflet.css ) * css/images ( was leaflet/images ) --- searx/static/themes/simple/gruntfile.js | 38 ++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) (limited to 'searx/static/themes/simple/gruntfile.js') diff --git a/searx/static/themes/simple/gruntfile.js b/searx/static/themes/simple/gruntfile.js index d4af12e65..d11ee6822 100644 --- a/searx/static/themes/simple/gruntfile.js +++ b/searx/static/themes/simple/gruntfile.js @@ -23,6 +23,41 @@ module.exports = function(grunt) { } } }, + copy: { + js: { + expand: true, + cwd: './node_modules', + dest: './js/', + flatten: true, + filter: 'isFile', + timestamp: true, + src: [ + './leaflet/dist/leaflet.js', + ] + }, + css: { + expand: true, + cwd: './node_modules', + dest: './css/', + flatten: true, + filter: 'isFile', + timestamp: true, + src: [ + './leaflet/dist/leaflet.css', + ] + }, + leaflet_images: { + expand: true, + cwd: './node_modules', + dest: './css/images/', + flatten: true, + filter: 'isFile', + timestamp: true, + src: [ + './leaflet/dist/images/*.png', + ] + }, + }, concat: { head_and_body: { options: { @@ -149,6 +184,7 @@ module.exports = function(grunt) { }); grunt.loadNpmTasks('grunt-contrib-watch'); + grunt.loadNpmTasks('grunt-contrib-copy'); grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-contrib-jshint'); grunt.loadNpmTasks('grunt-contrib-concat'); @@ -158,5 +194,5 @@ module.exports = function(grunt) { grunt.registerTask('test', ['jshint']); - grunt.registerTask('default', ['jshint', 'concat', 'uglify', 'less:development', 'less:production']); + grunt.registerTask('default', ['jshint', 'copy', 'concat', 'uglify', 'less:development', 'less:production']); }; -- cgit v1.2.3 From e3ebfd41d7379384186fd74a7db430247eef8c84 Mon Sep 17 00:00:00 2001 From: Alexandre Flament Date: Wed, 16 Jun 2021 12:13:37 +0200 Subject: [mod] simple theme: autocomplete-js becomes a packages.json dependency Update to version 2.7.1 --- searx/static/themes/simple/gruntfile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'searx/static/themes/simple/gruntfile.js') diff --git a/searx/static/themes/simple/gruntfile.js b/searx/static/themes/simple/gruntfile.js index d11ee6822..271e21b26 100644 --- a/searx/static/themes/simple/gruntfile.js +++ b/searx/static/themes/simple/gruntfile.js @@ -65,7 +65,7 @@ module.exports = function(grunt) { }, files: { 'js/searx.head.js': ['src/js/head/*.js'], - 'js/searx.js': ['src/js/main/*.js', '../__common__/js/*.js', 'js/autocomplete.js'] + 'js/searx.js': ['src/js/main/*.js', '../__common__/js/*.js', './node_modules/autocomplete-js/dist/autocomplete.js'] } } }, -- cgit v1.2.3 From 7137d2893f33e9158e8563a21d9586119d175269 Mon Sep 17 00:00:00 2001 From: Alexandre Flament Date: Wed, 16 Jun 2021 13:28:08 +0200 Subject: [mod] simple theme: remove src/less/ion.less This file is generated by webfont. * It is now generated as searx/static/themes/simple/ion.less * It is generated before the .less compilation. * .gitignore includes this file Add two new package depedencies: fontforge ttfautohint See utils/searx.sh --- searx/static/themes/simple/gruntfile.js | 64 ++++++++++++++++----------------- 1 file changed, 32 insertions(+), 32 deletions(-) (limited to 'searx/static/themes/simple/gruntfile.js') diff --git a/searx/static/themes/simple/gruntfile.js b/searx/static/themes/simple/gruntfile.js index 271e21b26..1dea80bd4 100644 --- a/searx/static/themes/simple/gruntfile.js +++ b/searx/static/themes/simple/gruntfile.js @@ -88,35 +88,6 @@ module.exports = function(grunt) { } } }, - less: { - development: { - options: { - paths: ["less"], - banner: '/*! searx | <%= grunt.template.today("dd-mm-yyyy") %> | <%= process.env.GIT_URL %> */\n' - }, - files: { - "css/searx.css": "src/less/style.less", - "css/searx-rtl.css": "src/less/style-rtl.less" - } - }, - production: { - options: { - paths: ["less"], - plugins: [ - new (require('less-plugin-clean-css'))() - ], - sourceMap: true, - sourceMapURL: (name) => { const s = name.split('/'); return s[s.length - 1] + '.map';}, - outputSourceFiles: false, - sourceMapRootpath: '../', - banner: '/*! searx | <%= grunt.template.today("dd-mm-yyyy") %> | <%= process.env.GIT_URL %> */\n' - }, - files: { - "css/searx.min.css": "src/less/style.less", - "css/searx-rtl.min.css": "src/less/style-rtl.less" - } - }, - }, webfont: { icons: { // src: 'node_modules/ionicons-npm/src/*.svg', @@ -146,7 +117,7 @@ module.exports = function(grunt) { 'node_modules/ionicons-npm/src/android-close.svg', ], dest: 'fonts', - destLess: 'less', + destLess: '.', options: { font: 'ion', hashes : true, @@ -180,7 +151,36 @@ module.exports = function(grunt) { } } } - } + }, + less: { + development: { + options: { + paths: ["less"], + banner: '/*! searx | <%= grunt.template.today("dd-mm-yyyy") %> | <%= process.env.GIT_URL %> */\n' + }, + files: { + "css/searx.css": "src/less/style.less", + "css/searx-rtl.css": "src/less/style-rtl.less" + } + }, + production: { + options: { + paths: ["less"], + plugins: [ + new (require('less-plugin-clean-css'))() + ], + sourceMap: true, + sourceMapURL: (name) => { const s = name.split('/'); return s[s.length - 1] + '.map';}, + outputSourceFiles: false, + sourceMapRootpath: '../', + banner: '/*! searx | <%= grunt.template.today("dd-mm-yyyy") %> | <%= process.env.GIT_URL %> */\n' + }, + files: { + "css/searx.min.css": "src/less/style.less", + "css/searx-rtl.min.css": "src/less/style-rtl.less" + } + }, + }, }); grunt.loadNpmTasks('grunt-contrib-watch'); @@ -194,5 +194,5 @@ module.exports = function(grunt) { grunt.registerTask('test', ['jshint']); - grunt.registerTask('default', ['jshint', 'copy', 'concat', 'uglify', 'less:development', 'less:production']); + grunt.registerTask('default', ['jshint', 'copy', 'concat', 'uglify', 'webfont', 'less:development', 'less:production']); }; -- cgit v1.2.3