diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 914ce163..ca0a0282 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -55,7 +55,7 @@ jobs: - name: Checkout uses: actions/checkout@v2 - name: Install Ubuntu packages - run: sudo ./utils/searx.sh install packages + run: sudo ./utils/searx.sh install buildhost - name: Install node dependencies run: make V=1 node.env - name: Build themes diff --git a/manage b/manage index 5237e6e1..d9190425 100755 --- a/manage +++ b/manage @@ -333,6 +333,7 @@ node.clean() { ./searx/static/themes/oscar/node_modules \ ./searx/static/themes/simple/package-lock.json \ ./searx/static/themes/simple/node_modules + ./searx/static/themes/simple/ion.less \ dump_return $? } diff --git a/searx/static/themes/simple/.gitignore b/searx/static/themes/simple/.gitignore index 07e6e472..2c1954c3 100644 --- a/searx/static/themes/simple/.gitignore +++ b/searx/static/themes/simple/.gitignore @@ -1 +1,2 @@ /node_modules +ion.less diff --git a/searx/static/themes/simple/gruntfile.js b/searx/static/themes/simple/gruntfile.js index 271e21b2..1dea80bd 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']); }; diff --git a/searx/static/themes/simple/src/less/ion.less b/searx/static/themes/simple/src/less/ion.less deleted file mode 100644 index c9e71559..00000000 --- a/searx/static/themes/simple/src/less/ion.less +++ /dev/null @@ -1,181 +0,0 @@ -// Generated by grunt-webfont - - -@font-face { - font-family:"ion"; - src:url("../fonts/ion.eot?ce7a0ead692560b4405a96d5b8471f51"); - src:url("../fonts/ion.eot?#iefix") format("embedded-opentype"), - url("../fonts/ion.woff2?ce7a0ead692560b4405a96d5b8471f51") format("woff2"), - url("../fonts/ion.woff?ce7a0ead692560b4405a96d5b8471f51") format("woff"), - url("../fonts/ion.ttf?ce7a0ead692560b4405a96d5b8471f51") format("truetype"), - url("../fonts/ion.svg?ce7a0ead692560b4405a96d5b8471f51#ion") format("svg"); - font-weight:normal; - font-style:normal; -} - -.ion-icon { - &:before { - font-family:"ion"; - } - display:inline-block; - vertical-align:middle; - line-height:1; - font-weight:normal; - font-style:normal; - speak:none; - text-decoration:inherit; - text-transform:none; - text-rendering:auto; - -webkit-font-smoothing:antialiased; - -moz-osx-font-smoothing:grayscale; -} - - -// Icons - -.ion-navicon-round { - &:before { - content:"\f101"; - } -} - - -.ion-search { - &:before { - content:"\f102"; - } -} - - -.ion-play { - &:before { - content:"\f103"; - } -} - - -.ion-link { - &:before { - content:"\f104"; - } -} - - -.ion-chevron-up { - &:before { - content:"\f105"; - } -} - - -.ion-chevron-left { - &:before { - content:"\f106"; - } -} - - -.ion-chevron-right { - &:before { - content:"\f107"; - } -} - - -.ion-arrow-down-a { - &:before { - content:"\f108"; - } -} - - -.ion-arrow-up-a { - &:before { - content:"\f109"; - } -} - - -.ion-arrow-swap { - &:before { - content:"\f10a"; - } -} - - -.ion-arrow-dropdown { - &:before { - content:"\f10b"; - } -} - - -.ion-globe { - &:before { - content:"\f10c"; - } -} - - -.ion-time { - &:before { - content:"\f10d"; - } -} - - -.ion-location { - &:before { - content:"\f10e"; - } -} - - -.ion-warning { - &:before { - content:"\f10f"; - } -} - - -.ion-error { - &:before { - content:"\f110"; - } -} - - -.ion-film-outline { - &:before { - content:"\f111"; - } -} - - -.ion-music-note { - &:before { - content:"\f112"; - } -} - - -.ion-more-vertical { - &:before { - content:"\f113"; - } -} - - -.ion-magnet { - &:before { - content:"\f114"; - } -} - - -.ion-close { - &:before { - content:"\f115"; - } -} - diff --git a/searx/static/themes/simple/src/less/style.less b/searx/static/themes/simple/src/less/style.less index 61c0a93d..82fcb00e 100644 --- a/searx/static/themes/simple/src/less/style.less +++ b/searx/static/themes/simple/src/less/style.less @@ -22,7 +22,7 @@ @import "autocomplete.less"; // ion-icon -@import "ion.less"; +@import "../../ion.less"; .ion-icon-big { .ion-icon; diff --git a/utils/searx.sh b/utils/searx.sh index a5345c07..e1ff4beb 100755 --- a/utils/searx.sh +++ b/utils/searx.sh @@ -51,7 +51,7 @@ shellcheck" BUILD_PACKAGES_debian="\ firefox graphviz imagemagick texlive-xetex librsvg2-bin texlive-latex-recommended texlive-extra-utils fonts-dejavu -latexmk" +latexmk fontforge ttfautohint" # pacman packages SEARX_PACKAGES_arch="\ @@ -62,7 +62,7 @@ shellcheck" BUILD_PACKAGES_arch="\ firefox graphviz imagemagick texlive-bin extra/librsvg -texlive-core texlive-latexextra ttf-dejavu" +texlive-core texlive-latexextra ttf-dejavu fontforge ttfautohint" # dnf packages SEARX_PACKAGES_fedora="\ @@ -75,7 +75,7 @@ BUILD_PACKAGES_fedora="\ firefox graphviz graphviz-gd ImageMagick librsvg2-tools texlive-xetex-bin texlive-collection-fontsrecommended texlive-collection-latex dejavu-sans-fonts dejavu-serif-fonts -dejavu-sans-mono-fonts" +dejavu-sans-mono-fonts fontforge ttfautohint" # yum packages SEARX_PACKAGES_centos="\ @@ -88,7 +88,7 @@ BUILD_PACKAGES_centos="\ firefox graphviz graphviz-gd ImageMagick librsvg2-tools texlive-xetex-bin texlive-collection-fontsrecommended texlive-collection-latex dejavu-sans-fonts dejavu-serif-fonts -dejavu-sans-mono-fonts" +dejavu-sans-mono-fonts fontforge ttfautohint" case $DIST_ID-$DIST_VERS in ubuntu-16.04|ubuntu-18.04)