这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@dalf
Copy link
Contributor

@dalf dalf commented May 8, 2022

What does this PR do?

  • move searx/templates/simple to searx/templates
  • the theme preferences is removed.
  • update the documentation (but do not changes the Makefile target names)
  • the following line has to be comment out:
    assert browser.is_text_present('COOKIES')

Why is this change important?

How to test this PR locally?

Author's checklist

In another PR, the source files of the static directory will be moved to the src directory.


The way to change the theme is going be in settings.yml:

static_path: ""
static_use_hash: false
# Custom templates path - leave it blank if you didn't change
templates_path: ""

The admin can have a second repository, then static_path and templates_path can reference this repository.

Related issues

@dalf
Copy link
Contributor Author

dalf commented May 8, 2022

@return42 FYI, it's a draft but the code won't change much (just fix found issue).

Comment on lines -295 to +293
"""Validates and saves preferences to cookies"""

def __init__(self, themes: List[str], categories: List[str], engines: Dict[str, Engine], plugins: Iterable[Plugin]):
def __init__(self, categories: List[str], engines: Dict[str, Engine], plugins: Iterable[Plugin]):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we really remove the theme option entirely. Maybe we want to support (external) themes one day?

I don't have a finial opinion, perhaps it is better after at all, to remove entirely first and think about a support of (external) themes when we have a need for.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After thinking twice .. its more clear if we remove the theme from the preferences entirely / #1153 (comment)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also agree. For now we only have the simple theme and in the future we can think about external themes / a new impl. of themes as only CSS for example...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the master branch, to add a new theme, a maintainer creates a directory in the templates and static directories ... and then the existing theme (the simple theme) is forgotten ; which make sense from the maintainer point of view.

See my-spot fork for example:

With this PR, we make sure only the maintained theme is available.

The remaining question: how my-spot deals with its own theme? (my-spot is an example here)

  • either reuse the templates and static directories.
  • either use two new directories, for example searx/etheme/templates and searx/etheme/static:
    • it is easier to backport commits (no conflicts)
    • the history of the searx/etheme directory is clean.

I'm not sure this is a good solution, but this PR:

  • make the code more straightforward / easier to understand for someone new to the project.
  • enforce the fact we won't support more than one theme.

note: my-spot is based of searx anyway.

@mrpaulblack
Copy link
Member

FYI this needs to be rebased on master before merge... Stuff like the products.html template is missing.

@dalf dalf force-pushed the remove_theme branch 3 times, most recently from 169848b to 46e3024 Compare May 14, 2022 12:07
@dalf dalf marked this pull request as ready for review May 20, 2022 10:35
@dalf dalf force-pushed the remove_theme branch 2 times, most recently from 81b5d4e to c68e8f8 Compare May 24, 2022 21:17
@dalf
Copy link
Contributor Author

dalf commented May 24, 2022

Before this PR, I would like to implement #1169 (comment) so the oscar's users can get back this layout.

@return42 return42 marked this pull request as draft May 25, 2022 04:31
@dalf dalf closed this Mar 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants