* ✨ feat(search): search all feature
- add Description field to Gist struct and index it
- extend SearchGistMetadata with Description and Content
- update Bleve and Meilisearch to index and search Description
- modify ParseSearchQueryStr to parse description: and content: keywords
- update templates and i18n for new search options
* Fix test
* Set content by default
Signed-off-by: Thomas Miceli <tho.miceli@gmail.com>
* Config to define default searchable fields
Signed-off-by: Thomas Miceli <tho.miceli@gmail.com>
---------
Signed-off-by: Thomas Miceli <tho.miceli@gmail.com>
Co-authored-by: Thomas Miceli <tho.miceli@gmail.com>
Due to the fact the file templates/base/base_header.html contains a
<base> element, all relative URLs are interpreted as dependant on the
base.[1]
I've noticed the base isn't the current page, but the element linking to
anchor identifier isn't using the complete URL to the gist page, which
means that if you go to a gist, and try to click on the link that leads
you to the file (which would make browsers automatically go down if it's
a file that has a lot of lines), you get taken to the homepage, and
unless you look at the URL closely you wouldn't notice the
fragment/anchor part.
I'm sure there's a better way of dealing with this, such as removing
<base> from the template mentioned above, but due to the fact I'd like
to have this work, I've made it put the full URL to this page.
Something that might be good to do is making the relative URLs always be
absolute, by having the '{{ $.c.ExternalUrl }}' thing everywhere where a
relative URL would be, as that'd probably fix#415, and would allow for
this commit to be reverted if that's desired.
[1] https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base
* Add a setting to allow accessing individual gists without auth
This is a middle ground between the existing setting "Require Login",
which requires login to do anything at all, and having it off, which
shows a public list of gists and more generally allows discovering info
about the users/gists of the instance without login.
The idea of this setting is that it is "require login" for everything
except individual gists.
Fixes#228.
Co-authored-by: Thomas Miceli <tho.miceli@gmail.com>