Merge branch 'searxng:master' into wikidata-fediverse

This commit is contained in:
Popolon 2025-01-17 22:23:14 +01:00 committed by GitHub
commit bd27c36de2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
28 changed files with 243 additions and 89 deletions

View file

@ -174,3 +174,4 @@ features or generally made searx better:
- @micsthepick - @micsthepick
- Daniel Kukula `<https://github.com/dkuku>` - Daniel Kukula `<https://github.com/dkuku>`
- Patrick Evans `https://github.com/holysoles` - Patrick Evans `https://github.com/holysoles`
- Daniel Mowitz `<https://daniel.mowitz.rocks>`

View file

@ -50,7 +50,7 @@ search.checker.%: install
$(Q)./manage pyenv.cmd searxng-checker -v "$(subst _, ,$(patsubst search.checker.%,%,$@))" $(Q)./manage pyenv.cmd searxng-checker -v "$(subst _, ,$(patsubst search.checker.%,%,$@))"
PHONY += test ci.test test.shell PHONY += test ci.test test.shell
ci.test: test.yamllint test.black test.pyright test.pylint test.unit test.robot test.rst test.pybabel ci.test: test.yamllint test.black test.pyright test.pylint test.unit test.robot test.rst test.pybabel test.themes
test: test.yamllint test.black test.pyright test.pylint test.unit test.robot test.rst test.shell test: test.yamllint test.black test.pyright test.pylint test.unit test.robot test.rst test.shell
test.shell: test.shell:
$(Q)shellcheck -x -s dash \ $(Q)shellcheck -x -s dash \
@ -83,8 +83,9 @@ MANAGE += node.env node.env.dev node.clean
MANAGE += py.build py.clean MANAGE += py.build py.clean
MANAGE += pyenv pyenv.install pyenv.uninstall MANAGE += pyenv pyenv.install pyenv.uninstall
MANAGE += format.python MANAGE += format.python
MANAGE += test.yamllint test.pylint test.pyright test.black test.pybabel test.unit test.coverage test.robot test.rst test.clean MANAGE += test.yamllint test.pylint test.pyright test.black test.pybabel test.unit test.coverage test.robot test.rst test.clean test.themes
MANAGE += themes.all themes.simple themes.simple.test pygments.less MANAGE += themes.all themes.fix themes.test
MANAGE += themes.simple themes.simple.pygments themes.simple.fix
MANAGE += static.build.commit static.build.drop static.build.restore MANAGE += static.build.commit static.build.drop static.build.restore
MANAGE += nvm.install nvm.clean nvm.status nvm.nodejs MANAGE += nvm.install nvm.clean nvm.status nvm.nodejs

View file

@ -6,7 +6,8 @@ Development Quickstart
.. _npm: https://www.npmjs.com/ .. _npm: https://www.npmjs.com/
.. _Node.js: https://nodejs.org/ .. _Node.js: https://nodejs.org/
.. _eslint: https://eslint.org/
.. _stylelint: https://stylelint.io/
.. sidebar:: further read .. sidebar:: further read
@ -40,7 +41,8 @@ to our ":ref:`how to contribute`" guideline.
If you implement themes, you will need to setup a :ref:`Node.js environment If you implement themes, you will need to setup a :ref:`Node.js environment
<make node.env>`. Before you call *make run* (2.), you need to compile the <make node.env>`. Before you call *make run* (2.), you need to compile the
modified styles and JavaScript: ``make node.clean themes.all`` modified styles and JavaScript: ``make node.clean themes.all``. If eslint_ or
stylelint_ report some issues, try ``make themes.fix``.
Alternatively you can also compile selective the theme you have modified, Alternatively you can also compile selective the theme you have modified,
e.g. the *simple* theme. e.g. the *simple* theme.

View file

@ -0,0 +1,93 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
""".. sidebar:: info
The Astrophysics Data System (ADS) is a digital library portal for researchers in astronomy and physics,
operated by the Smithsonian Astrophysical Observatory (SAO) under a NASA grant.
The engine is adapted from the solr engine.
"""
# pylint: disable=global-statement
from datetime import datetime
from json import loads
from urllib.parse import urlencode
from searx.exceptions import SearxEngineAPIException
about = {
"website": 'https://ui.adsabs.harvard.edu/',
"wikidata_id": 'Q752099',
"official_api_documentation": 'https://ui.adsabs.harvard.edu/help/api/api-docs.html',
"use_official_api": True,
"require_api_key": True,
"results": 'JSON',
}
base_url = 'https://api.adsabs.harvard.edu/v1/search'
result_base_url = 'https://ui.adsabs.harvard.edu/abs/'
rows = 10
sort = '' # sorting: asc or desc
field_list = ['bibcode', 'author', 'title', 'abstract', 'doi', 'date'] # list of field names to display on the UI
default_fields = '' # default field to query
query_fields = '' # query fields
paging = True
api_key = 'unset'
def init(_):
if api_key == 'unset':
raise SearxEngineAPIException('missing ADS API key')
def request(query, params):
query_params = {'q': query, 'rows': rows}
if field_list:
query_params['fl'] = ','.join(field_list)
if query_fields:
query_params['qf'] = ','.join(query_fields)
if default_fields:
query_params['df'] = default_fields
if sort:
query_params['sort'] = sort
query_params['start'] = rows * (params['pageno'] - 1)
params['headers']['Authorization'] = f'Bearer {api_key}'
params['url'] = f"{base_url}/query?{urlencode(query_params)}"
return params
def response(resp):
try:
resp_json = loads(resp.text)
except Exception as e:
raise SearxEngineAPIException("failed to parse response") from e
if 'error' in resp_json:
raise SearxEngineAPIException(resp_json['error']['msg'])
resp_json = resp_json["response"]
result_len = resp_json["numFound"]
results = []
for res in resp_json["docs"]:
author = res.get("author")
if author:
author = author[0] + ' et al.'
results.append(
{
'url': result_base_url + res.get("bibcode") + "/",
'title': res.get("title")[0],
'author': author,
'content': res.get("abstract"),
'doi': res.get("doi"),
'publishedDate': datetime.fromisoformat(res.get("date")),
}
)
results.append({'number_of_results': result_len})
return results

View file

@ -380,6 +380,14 @@ engines:
require_api_key: false require_api_key: false
results: JSON results: JSON
# - name: astrophysics data system
# engine: astrophysics_data_system
# sort: asc
# weight: 5
# categories: [science]
# api_key: your-new-key
# shortcut: ads
- name: alpine linux packages - name: alpine linux packages
engine: alpinelinux engine: alpinelinux
disabled: true disabled: true

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -21,9 +21,10 @@ module.exports = function (grunt) {
pkg: grunt.file.readJSON('package.json'), pkg: grunt.file.readJSON('package.json'),
watch: { watch: {
scripts: { scripts: {
files: ['gruntfile.js', 'src/**'], files: ['gruntfile.js', 'eslint.config.mjs', '.stylelintrc.json', 'src/**'],
tasks: [ tasks: [
'eslint', 'eslint',
'stylelint',
'copy', 'copy',
'uglify', 'uglify',
'less', 'less',
@ -49,6 +50,7 @@ module.exports = function (grunt) {
stylelint: { stylelint: {
options: { options: {
formatter: 'unix', formatter: 'unix',
fix: grunt.option('fix')
}, },
src: [ src: [
'src/less/**/*.less', 'src/less/**/*.less',
@ -298,7 +300,7 @@ module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-stylelint'); grunt.loadNpmTasks('grunt-stylelint');
grunt.loadNpmTasks('grunt-eslint'); grunt.loadNpmTasks('grunt-eslint');
grunt.registerTask('test', ['eslint']); grunt.registerTask('test', ['eslint', 'stylelint']);
grunt.registerTask('default', [ grunt.registerTask('default', [
'eslint', 'eslint',

View file

@ -29,12 +29,13 @@
"scripts": { "scripts": {
"all": "npm install && grunt", "all": "npm install && grunt",
"build": "grunt", "build": "grunt",
"test": "grunt test", "clean": "rm -Rf node_modules",
"eslint": "grunt eslint", "eslint": "grunt eslint",
"eslint-fix": "grunt eslint --fix", "eslint-fix": "grunt eslint --fix",
"watch": "grunt watch", "fix": "grunt test --fix",
"clean": "rm -Rf node_modules",
"stylelint": "grunt stylelint", "stylelint": "grunt stylelint",
"stylelint-fix": "grunt stylelint --fix" "stylelint-fix": "grunt stylelint --fix",
"test": "grunt test",
"watch": "grunt watch --fix"
} }
} }

View file

@ -53,7 +53,7 @@
color: var(--color-autocomplete-font); color: var(--color-autocomplete-font);
max-height: 32rem; max-height: 32rem;
overflow-y: auto; overflow-y: auto;
z-index: 100; z-index: 5000;
margin-top: 3.5rem; margin-top: 3.5rem;
border-radius: 0.8rem; border-radius: 0.8rem;

View file

@ -280,7 +280,7 @@
@results-image-row-height-phone: 10rem; @results-image-row-height-phone: 10rem;
@search-width: 44rem; @search-width: 44rem;
// heigh of #search, see detail.less // heigh of #search, see detail.less
@search-height: 7.6rem; @search-height: 13rem;
/// Device Size /// Device Size
/// @desktop > @tablet /// @desktop > @tablet

View file

@ -22,7 +22,7 @@ article.result-images .detail {
bottom: 0; bottom: 0;
background: var(--color-result-detail-background); background: var(--color-result-detail-background);
border: 1px solid var(--color-result-detail-background); border: 1px solid var(--color-result-detail-background);
z-index: 10000; z-index: 1000;
padding: 4rem 3rem 3rem 3rem; padding: 4rem 3rem 3rem 3rem;
a.result-images-source { a.result-images-source {
@ -148,7 +148,7 @@ article.result-images .detail {
height: 1.5rem; height: 1.5rem;
position: absolute; position: absolute;
filter: opacity(40%); filter: opacity(40%);
z-index: 2000002; z-index: 1200;
span { span {
display: block; display: block;

View file

@ -158,7 +158,7 @@ button.category_button {
outline: none; outline: none;
color: var(--color-search-font); color: var(--color-search-font);
font-size: 1.1rem; font-size: 1.1rem;
z-index: 10000; z-index: 1000;
&:hover { &:hover {
color: var(--color-search-background-hover); color: var(--color-search-background-hover);
@ -183,7 +183,7 @@ html.no-js #clear_search.hide_if_nojs {
outline: none; outline: none;
color: var(--color-search-font); color: var(--color-search-font);
font-size: 1.1rem; font-size: 1.1rem;
z-index: 2; z-index: 100;
} }
#q { #q {
@ -332,7 +332,7 @@ html.no-js #clear_search.hide_if_nojs {
top: 0; top: 0;
height: 100%; height: 100%;
width: 100%; width: 100%;
z-index: 10000; z-index: 2000;
.search_box { .search_box {
border-bottom: 1px solid var(--color-search-border); border-bottom: 1px solid var(--color-search-border);

View file

@ -543,7 +543,13 @@ article[data-vim-selected].category-social {
margin-bottom: 0; margin-bottom: 0;
.ltr-margin-left(@results-offset); .ltr-margin-left(@results-offset);
display: grid; display: grid;
grid-template: "corrections sidebar" min-content "answers sidebar" min-content "urls sidebar" 1fr "pagination sidebar" min-content / @results-width @results-sidebar-width; grid-template:
"corrections sidebar" min-content
"answers sidebar" min-content
"urls sidebar" 1fr
"pagination sidebar" min-content
/ @results-width @results-sidebar-width
;
gap: 0 @results-gap; gap: 0 @results-gap;
} }
@ -967,7 +973,14 @@ summary.title {
margin: 0 auto; margin: 0 auto;
justify-content: center; justify-content: center;
display: grid; display: grid;
grid-template: "corrections" min-content "answers" min-content "sidebar" min-content "urls" 1fr "pagination" min-content min-content / @results-width; grid-template:
"corrections" min-content
"answers" min-content
"sidebar" min-content
"urls" 1fr
"pagination" min-content
/ @results-width
;
gap: 0; gap: 0;
} }
} }
@ -1005,7 +1018,13 @@ summary.title {
#main_results div#results.only_template_images { #main_results div#results.only_template_images {
margin: 1rem @results-tablet-offset 0 @results-tablet-offset; margin: 1rem @results-tablet-offset 0 @results-tablet-offset;
display: grid; display: grid;
grid-template: "corrections" min-content "answers" min-content "sidebar" min-content "urls" 1fr "pagination" min-content / 100%; grid-template:
"corrections" min-content
"answers" min-content
"sidebar" min-content
"urls" 1fr
"pagination" min-content
/ 100%;
gap: 0; gap: 0;
#sidebar { #sidebar {

View file

@ -203,7 +203,7 @@ div.selectable_url {
left: 50%; left: 50%;
margin: 0 auto; margin: 0 auto;
transform: translate(-50%, -50%); transform: translate(-50%, -50%);
z-index: 10000000; z-index: 5000;
h3 { h3 {
margin-top: 0; margin-top: 0;
@ -339,7 +339,7 @@ select {
padding: 0.2rem !important; padding: 0.2rem !important;
color: var(--color-search-font); color: var(--color-search-font);
font-size: 0.9rem; font-size: 0.9rem;
z-index: 2; z-index: 100;
&:hover, &:hover,
&:focus { &:focus {
@ -413,7 +413,7 @@ input.checkbox-onoff[type="checkbox"] {
border: 1px solid var(--color-btn-background); border: 1px solid var(--color-btn-background);
border-radius: 12px; border-radius: 12px;
box-shadow: var(--color-btn-background) 0 0 3px; box-shadow: var(--color-btn-background) 0 0 3px;
z-index: 10000; z-index: 1200;
top: -0.55em; top: -0.55em;
left: -0.6em; left: -0.6em;
} }
@ -573,7 +573,7 @@ input.checkbox-onoff.reversed-checkbox[type="checkbox"] {
background: var(--color-toolkit-engine-tooltip-background); background: var(--color-toolkit-engine-tooltip-background);
font-size: 14px; font-size: 14px;
font-weight: normal; font-weight: normal;
z-index: 1000000; z-index: 5000;
text-align: left; text-align: left;
.rounded-corners; .rounded-corners;
} }

View file

@ -25,20 +25,20 @@
# Yahya-Lando <yahya-lando@users.noreply.translate.codeberg.org>, 2025. # Yahya-Lando <yahya-lando@users.noreply.translate.codeberg.org>, 2025.
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: searx\n" "Project-Id-Version: searx\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2025-01-06 16:16+0000\n" "POT-Creation-Date: 2025-01-06 16:16+0000\n"
"PO-Revision-Date: 2025-01-06 15:52+0000\n" "PO-Revision-Date: 2025-01-15 06:48+0000\n"
"Last-Translator: Yahya-Lando <yahya-" "Last-Translator: return42 <return42@users.noreply.translate.codeberg.org>\n"
"lando@users.noreply.translate.codeberg.org>\n" "Language-Team: Arabic <https://translate.codeberg.org/projects/searxng/"
"searxng/ar/>\n"
"Language: ar\n" "Language: ar\n"
"Language-Team: Arabic "
"<https://translate.codeberg.org/projects/searxng/searxng/ar/>\n"
"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : "
"n%100>=3 && n%100<=10 ? 3 : n%100>=11 ? 4 : 5;\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n" "Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 "
"&& n%100<=10 ? 3 : n%100>=11 ? 4 : 5;\n"
"X-Generator: Weblate 5.9.2\n"
"Generated-By: Babel 2.16.0\n" "Generated-By: Babel 2.16.0\n"
#. CONSTANT_NAMES['NO_SUBGROUPING'] #. CONSTANT_NAMES['NO_SUBGROUPING']
@ -1380,23 +1380,23 @@ msgstr "تغيير لغة واجهة البحث"
#: searx/templates/simple/preferences/urlformatting.html:2 #: searx/templates/simple/preferences/urlformatting.html:2
msgid "URL formatting" msgid "URL formatting"
msgstr "" msgstr "تنسيق العنوان"
#: searx/templates/simple/preferences/urlformatting.html:8 #: searx/templates/simple/preferences/urlformatting.html:8
msgid "Pretty" msgid "Pretty"
msgstr "" msgstr "جميل"
#: searx/templates/simple/preferences/urlformatting.html:13 #: searx/templates/simple/preferences/urlformatting.html:13
msgid "Full" msgid "Full"
msgstr "" msgstr "ممتلىء"
#: searx/templates/simple/preferences/urlformatting.html:18 #: searx/templates/simple/preferences/urlformatting.html:18
msgid "Host" msgid "Host"
msgstr "" msgstr "مضيف"
#: searx/templates/simple/preferences/urlformatting.html:23 #: searx/templates/simple/preferences/urlformatting.html:23
msgid "Change result URL formatting" msgid "Change result URL formatting"
msgstr "" msgstr "تغيير تنسيق العنوان للنتيجة"
#: searx/templates/simple/result_templates/code.html:13 #: searx/templates/simple/result_templates/code.html:13
msgid "repo" msgid "repo"
@ -2004,4 +2004,3 @@ msgstr "إخفاء الفيديو"
#~ msgid "dummy" #~ msgid "dummy"
#~ msgstr "" #~ msgstr ""

View file

@ -27,19 +27,19 @@
# syobon <syobon@users.noreply.translate.codeberg.org>, 2025. # syobon <syobon@users.noreply.translate.codeberg.org>, 2025.
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: searx\n" "Project-Id-Version: searx\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2025-01-06 16:16+0000\n" "POT-Creation-Date: 2025-01-06 16:16+0000\n"
"PO-Revision-Date: 2025-01-06 15:53+0000\n" "PO-Revision-Date: 2025-01-17 07:09+0000\n"
"Last-Translator: return42 <return42@users.noreply.translate.codeberg.org>" "Last-Translator: tentsbet <tentsbet@users.noreply.translate.codeberg.org>\n"
"\n" "Language-Team: Japanese <https://translate.codeberg.org/projects/searxng/"
"searxng/ja/>\n"
"Language: ja\n" "Language: ja\n"
"Language-Team: Japanese "
"<https://translate.codeberg.org/projects/searxng/searxng/ja/>\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n" "Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: Weblate 5.9.2\n"
"Generated-By: Babel 2.16.0\n" "Generated-By: Babel 2.16.0\n"
#. CONSTANT_NAMES['NO_SUBGROUPING'] #. CONSTANT_NAMES['NO_SUBGROUPING']
@ -1348,23 +1348,23 @@ msgstr "表示する言語を変更"
#: searx/templates/simple/preferences/urlformatting.html:2 #: searx/templates/simple/preferences/urlformatting.html:2
msgid "URL formatting" msgid "URL formatting"
msgstr "" msgstr "URL 書式"
#: searx/templates/simple/preferences/urlformatting.html:8 #: searx/templates/simple/preferences/urlformatting.html:8
msgid "Pretty" msgid "Pretty"
msgstr "" msgstr "相当"
#: searx/templates/simple/preferences/urlformatting.html:13 #: searx/templates/simple/preferences/urlformatting.html:13
msgid "Full" msgid "Full"
msgstr "" msgstr "一杯"
#: searx/templates/simple/preferences/urlformatting.html:18 #: searx/templates/simple/preferences/urlformatting.html:18
msgid "Host" msgid "Host"
msgstr "" msgstr "ホスト"
#: searx/templates/simple/preferences/urlformatting.html:23 #: searx/templates/simple/preferences/urlformatting.html:23
msgid "Change result URL formatting" msgid "Change result URL formatting"
msgstr "" msgstr "検索結果のURL書式を変更"
#: searx/templates/simple/result_templates/code.html:13 #: searx/templates/simple/result_templates/code.html:13
msgid "repo" msgid "repo"
@ -1947,4 +1947,3 @@ msgstr "動画を隠す"
#~ msgid "dummy" #~ msgid "dummy"
#~ msgstr "" #~ msgstr ""

View file

@ -14,20 +14,21 @@
# Mooo <mooo@users.noreply.translate.codeberg.org>, 2025. # Mooo <mooo@users.noreply.translate.codeberg.org>, 2025.
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: searx\n" "Project-Id-Version: searx\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2025-01-06 16:16+0000\n" "POT-Creation-Date: 2025-01-06 16:16+0000\n"
"PO-Revision-Date: 2025-01-06 15:53+0000\n" "PO-Revision-Date: 2025-01-15 06:48+0000\n"
"Last-Translator: Mooo <mooo@users.noreply.translate.codeberg.org>\n" "Last-Translator: return42 <return42@users.noreply.translate.codeberg.org>\n"
"Language-Team: Lithuanian <https://translate.codeberg.org/projects/searxng/"
"searxng/lt/>\n"
"Language: lt\n" "Language: lt\n"
"Language-Team: Lithuanian "
"<https://translate.codeberg.org/projects/searxng/searxng/lt/>\n"
"Plural-Forms: nplurals=4; plural=(n % 10 == 1 && (n % 100 > 19 || n % 100"
" < 11) ? 0 : (n % 10 >= 2 && n % 10 <=9) && (n % 100 > 19 || n % 100 < "
"11) ? 1 : n % 1 != 0 ? 2: 3);\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n" "Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=4; plural=(n % 10 == 1 && (n % 100 > 19 || n % 100 < "
"11) ? 0 : (n % 10 >= 2 && n % 10 <=9) && (n % 100 > 19 || n % 100 < 11) ? 1 :"
" n % 1 != 0 ? 2: 3);\n"
"X-Generator: Weblate 5.9.2\n"
"Generated-By: Babel 2.16.0\n" "Generated-By: Babel 2.16.0\n"
#. CONSTANT_NAMES['NO_SUBGROUPING'] #. CONSTANT_NAMES['NO_SUBGROUPING']
@ -168,7 +169,7 @@ msgstr "tamsi"
#. STYLE_NAMES['BLACK'] #. STYLE_NAMES['BLACK']
#: searx/searxng.msg #: searx/searxng.msg
msgid "black" msgid "black"
msgstr "" msgstr "juoda"
#. BRAND_CUSTOM_LINKS['UPTIME'] #. BRAND_CUSTOM_LINKS['UPTIME']
#: searx/searxng.msg #: searx/searxng.msg
@ -1981,4 +1982,3 @@ msgstr "slėpti vaizdo įrašą"
#~ msgid "dummy" #~ msgid "dummy"
#~ msgstr "" #~ msgstr ""

View file

@ -14,7 +14,7 @@ msgstr ""
"Project-Id-Version: PROJECT VERSION\n" "Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2025-01-06 16:16+0000\n" "POT-Creation-Date: 2025-01-06 16:16+0000\n"
"PO-Revision-Date: 2025-01-10 07:09+0000\n" "PO-Revision-Date: 2025-01-15 06:48+0000\n"
"Last-Translator: hirushaadi <hirushaadi@users.noreply.translate.codeberg.org>" "Last-Translator: hirushaadi <hirushaadi@users.noreply.translate.codeberg.org>"
"\n" "\n"
"Language-Team: Sinhala <https://translate.codeberg.org/projects/searxng/" "Language-Team: Sinhala <https://translate.codeberg.org/projects/searxng/"
@ -313,7 +313,7 @@ msgstr ""
#. SOCIAL_MEDIA_TERMS['COMMUNITY'] #. SOCIAL_MEDIA_TERMS['COMMUNITY']
#: searx/engines/lemmy.py:131 searx/engines/lemmy.py:165 searx/searxng.msg #: searx/engines/lemmy.py:131 searx/engines/lemmy.py:165 searx/searxng.msg
msgid "community" msgid "community"
msgstr "" msgstr "ප්‍රජාව or පිරිස"
#. SOCIAL_MEDIA_TERMS['POINTS'] #. SOCIAL_MEDIA_TERMS['POINTS']
#: searx/engines/hackernews.py:82 searx/searxng.msg #: searx/engines/hackernews.py:82 searx/searxng.msg

View file

@ -100,7 +100,8 @@ static.build.commit() {
static.build.drop &>/dev/null static.build.drop &>/dev/null
( set -e ( set -e
# build the themes # fix & build the themes
themes.fix
themes.all themes.all
# add build files # add build files

View file

@ -89,7 +89,6 @@ test.robot() {
dump_return $? dump_return $?
} }
test.rst() { test.rst() {
build_msg TEST "[reST markup] ${RST_FILES[*]}" build_msg TEST "[reST markup] ${RST_FILES[*]}"
@ -98,6 +97,12 @@ test.rst() {
done done
} }
test.themes() {
build_msg TEST 'SearXNG themes'
themes.test
dump_return $?
}
test.pybabel() { test.pybabel() {
TEST_BABEL_FOLDER="build/test/pybabel" TEST_BABEL_FOLDER="build/test/pybabel"
build_msg TEST "[extract messages] pybabel" build_msg TEST "[extract messages] pybabel"

View file

@ -7,21 +7,41 @@ declare _creset
themes.help(){ themes.help(){
cat <<EOF cat <<EOF
themes.: themes.:
all : build all themes all : test & build all themes
live : to get live builds of CSS & JS use 'LIVE_THEME=simple make run' test : test all themes
simple.: build simple theme fix : fix JS & CSS (LESS)
test : test simple theme live : to get live builds of CSS & JS use: LIVE_THEME=simple make run
simple.: test & build simple theme ..
pygments: build pygment's LESS files for simple theme pygments: build pygment's LESS files for simple theme
test : test simple theme
fix : fix JS & CSS (LESS) of the simple theme
EOF EOF
} }
themes.all() { themes.all() {
( set -e ( set -e
node.env
themes.simple themes.simple
) )
dump_return $? dump_return $?
} }
themes.fix() {
( set -e
node.env
themes.simple.fix
)
dump_return $?
}
themes.test() {
( set -e
node.env
themes.simple.test
)
dump_return $?
}
themes.live() { themes.live() {
local LIVE_THEME="${LIVE_THEME:-${1}}" local LIVE_THEME="${LIVE_THEME:-${1}}"
case "${LIVE_THEME}" in case "${LIVE_THEME}" in
@ -29,30 +49,30 @@ themes.live() {
theme="searx/static/themes/${LIVE_THEME}" theme="searx/static/themes/${LIVE_THEME}"
;; ;;
'') '')
die_caller 42 "missing theme argument" die 42 "missing theme argument"
;; ;;
*) *)
die_caller 42 "unknown theme '${LIVE_THEME}' // [simple]'" die 42 "unknown theme '${LIVE_THEME}' // [simple]'"
;; ;;
esac esac
build_msg GRUNT "theme: $1 (live build)" build_msg SIMPLE "theme: $1 (live build)"
nodejs.ensure node.env
themes.simple.pygments
cd "${theme}" cd "${theme}"
{ {
npm install
npm run watch npm run watch
} 2>&1 \ } # 2>&1 \
| prefix_stdout "${_Blue}THEME ${1} ${_creset} " \ # | prefix_stdout "${_Blue}THEME ${1} ${_creset} " \
| grep -E --ignore-case --color 'error[s]?[:]? |warning[s]?[:]? |' # | grep -E --ignore-case --color 'error[s]?[:]? |warning[s]?[:]? |'
} }
themes.simple() { themes.simple() {
( set -e ( set -e
node.env
themes.simple.pygments themes.simple.pygments
build_msg SIMPLE "theme: run build"
# "run build" includes tests from eslint and stylelint
npm --prefix searx/static/themes/simple run build
) )
build_msg GRUNT "theme: simple"
npm --prefix searx/static/themes/simple run build
dump_return $? dump_return $?
} }
@ -67,11 +87,14 @@ themes.simple.pygments() {
return 0 return 0
} }
themes.simple.fix() {
build_msg SIMPLE "theme: fix"
npm --prefix searx/static/themes/simple run fix
dump_return $?
}
themes.simple.test() { themes.simple.test() {
build_msg TEST "theme: simple" build_msg SIMPLE "theme: run test"
node.env
npm --prefix searx/static/themes/simple install
npm --prefix searx/static/themes/simple run test npm --prefix searx/static/themes/simple run test
dump_return $? dump_return $?
} }