-
Notifications
You must be signed in to change notification settings - Fork 25.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
search via jquery #1011
Comments
This is something you can add with a plugin or the addition of a simple script and .json file. See this issue as others have it working with the theme. |
I've got it working for my site. @mmistakes do you want me to pr ? |
+1 from me, built-in search would be great. The other threads suggest using those plugins can be a hassle. |
+1 from me too it's really a PITA setting it up |
One important note to make is that jekyll-lunr-js-search says "UNSUPPORTED" in its GH page, and the new kid on the block looks to be https://github.com/christian-fei/Simple-Jekyll-Search. |
Any solution I add will likely still be a pain to setup as it require a search page to be created. Similar to the category/tag implementation. One of my other themes has search built in and it's fairly fragile and not something I enjoy supporting which is why I've left it out of this theme. |
Simple Jekyll Search is hardly new. I've used it in a few projects and it has the same flaw as most. The |
How about just a UI placeholder for the search box then? Getting the search script/engine running properly could probably be done without too many issues, but what really worries me is where and how to place the search box (and have it behave properly relative to all the other UI elements in different resolutions, on mobile, etc). |
That worries me to as I don't have a good place to put it without completely gutting the masthead/navbar 😐 |
Could it perhaps be treated exactly like a navigation item (just like e.g. "About" and "Sample posts" in your demo site)? |
That's probably how I'd handle it. Cue PRs and issues asking for it to be placed first/last in the list, always be visible, and various other custom placements 😂 |
Haha those pesky users :) I really think it would add a lot of value even without all those features. I can handle the great responsibility of putting it first in |
You might be able to, but the vast majority of users in academia using my theme as a simple way to spit out Markdown docs usually can't. Jekyll in general is a steep learning curve just because of all the baggage you need to be familiar with (Markdown, setting up a Ruby environment, HTML/CSS best practices, etc.) For something I put out there for free expectations need to be kept in check. Bootstrap or a premium Wordpress theme this project is not. |
Clearly understood. What if you just throw it in in the most basic way as an optional element in |
How about the bottom of the left column? |
@igoratencompass too hidden/remote IMHO. People are used to have the search box at the top (e.g. Google, or even the popular WP themes). Also, that's where the author pane is, seems out of place to be adjacent to the search box... |
@ohadschn it will always be visible to the users though even if they scroll down |
@igoratencompass good point. Perhaps putting it above the author div could be a good idea too. |
This issue has been automatically marked as stale because it has not had recent activity. If this is a bug and you can still reproduce this error on the If this is a feature request, please consider whether it can be accomplished in another way. If it cannot, please elaborate on why it is core to this project and why you feel more than 80% of users would find this beneficial. This issue will automatically be closed in 7 days if no further activity occurs. Thank you for all your contributions. |
@mmistakes what do you want to do about this one? As I stated above IMHO this could be downgraded to a simple UI placeholder (as discussed above) where one would configure one's own search on one's own. |
@ohadschn I don't think there's a way to do this without introducing even more complexity and configuration to the theme. Any sort of UI widget I built will have to be customized to fit whatever search method you go with. And at that point it will defeat the purpose of me including it in the theme because there will be those who don't want to override an Show me some examples of Jekyll themes` that and I might re-consider:
Most themes I've seen who have search baked-in, either use one prescribed method (not ideal), or just link to a |
What about just a Google site search box and be done with it? It's global and simple enough... |
I have a feeling a Google site search box is the least desired option from the bunch... your site needs to be indexed well with the Googs, Google haters will piss on it, etc. I'd lean towards a simple search using a |
What site today isn't indexed well with Google??? And I think Google haters are a very small minority (heck, I work for Microsoft and I just suggested it, but a Bing box would be cool too 😉). Like you said before, this theme is for the average/common user. Presumably that user just wants a search box that works with no extra effort. More advanced users can fork / customize and deal with the JSON search issues (which I'm sure get much worse when you get to a certain size that the client simply can't handle). |
You'd be surprised how many aren't indexed or indexed well. I get emails, tweets, GH issues all the time from those who've added a Google site search box and get no results thinking something is broken. The issue is almost always Jekyll powered blog, hosted on GitHub Pages or with a new domain name. New sites aren't always crawled right away even if you setup Google Search Console and explaining the finer points around that and SEO is another area I don't really want dip into 😉 |
haha I hear you! |
Hi guys, |
@nickgarlis I'm still not convinced I want to bake this into the theme. But if you have a demo and source of it publicly somewhere for me to look at I will. If I think it's something easily incorporated into the theme then a PR would be the next step. If not, then at the least there's a working example for others to follow. |
I have a demo of it on an old fork of the theme . However, my source code is still kinda messy and not really what I have in mind for the theme... I'll have another one in the next couple of days. |
@nickgarlis Looks to be on the right track. Your solution is what I was thinking... put the search form on a page versus trying to stuff it in the header. I think if you abstract the search page into a new layout eg. |
@mmistakes Yeah I don't think it would be a good idea to put it in the header since the results are live. |
IMHO having a separate dedicated search page is cool, but doesn't really replace a search bar that is just always there. I don't think I an come up with a single site that has a search page but no search bar... |
@ohadschn Search bar will be an exclusive feature in the $90 MM Premium upgrade 😉 |
@mmistakes After making a few adjustments I finally pushed my source code into a new repository. Here is a demo . This searches in every collection. |
@nickgarlis Good job, can't think of anything you missed. One small suggestion would be to flip the order of the search input and {{ content }}
<input placeholder="Search..." type="search" id="search" class="search-input">
<div id="results"></div> Other than that if you want to fire it off as a PR I'll work on merging it in and adding some documentation around it. |
* Add `search.html` layout and JavaScript * Move `{{ content }}` before search input * Add spaces for consistency Close mmistakes#1011
* Add `search.html` layout and JavaScript * Move `{{ content }}` before search input * Add spaces for consistency Close mmistakes#1011
* Add `search.html` layout and JavaScript * Move `{{ content }}` before search input * Add spaces for consistency Close mmistakes#1011
Environment informations
N/A
Expected behavior
Output search results on a search page using jquery
The text was updated successfully, but these errors were encountered: