WIP: Experimenting with embedding in an iframe on the Jekyll site.
In the image below, note the following:
- The page
http://localhost:4000/search
is the Jekyll website fromfdroid-website
. - The search box, search button, and results in the main part of the screen are all in an
<iframe>
. - The
iframe
points tohttp://localhost:8000
which is running the djangofdroid-website-search
project. - Entering/changing search terms and pressing search (or hitting Enter) will only update the iframe, the outer page stays the same.
- Clicking a search result will redirect the outer page to the relevant package page (e.g.
http://localhost:4000/packages/org.torproject.android
). This is done by settingtarget="_top"
in the package result lists<a>
element.
Limitations:
- Can't bookmark search results, because the outer page is always stays at the same URL. This could be fixed with JS I think, by letting the inner iframe update the parent URL to something like
/search#q=internet
which wont refresh the page, but will make the URL change. Then when rendering the iframe, if JS is enabled we could change thesrc
of the<iframe>
to besrc="search.f-droid.org/q=internet"
.
The user experience feels pretty good now, except for the lack of being able to bookmark search results.
Edited by Peter Serwylo