From 7137d2893f33e9158e8563a21d9586119d175269 Mon Sep 17 00:00:00 2001 From: Alexandre Flament Date: Wed, 16 Jun 2021 13:28:08 +0200 Subject: [PATCH] [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 --- .github/workflows/integration.yml | 2 +- manage | 1 + searx/static/themes/simple/.gitignore | 1 + searx/static/themes/simple/gruntfile.js | 64 +++---- searx/static/themes/simple/src/less/ion.less | 181 ------------------ .../static/themes/simple/src/less/style.less | 2 +- utils/searx.sh | 8 +- 7 files changed, 40 insertions(+), 219 deletions(-) delete mode 100644 searx/static/themes/simple/src/less/ion.less diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 914ce163f..ca0a02824 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 5237e6e1b..d91904255 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 07e6e472c..2c1954c3c 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 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']); }; 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 c9e715591..000000000 --- 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 61c0a93de..82fcb00ed 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 a5345c075..e1ff4beb0 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)