Skip to content
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

Feature suggestion: Blog post search bar #770

Closed
ghost opened this issue Jan 29, 2021 · 3 comments
Closed

Feature suggestion: Blog post search bar #770

ghost opened this issue Jan 29, 2021 · 3 comments

Comments

@ghost
Copy link

ghost commented Jan 29, 2021

A search bar to more easily navigate blog posts could be beneficial when having 4+ pages.
A possible candidate for this could be Simple-Jekyll-Search. I've implemented it on my website already and think it would be a good addition to Beautiful Jekyll.

JSFiddle Demonstration (this is done with liquid and a "search.json" config file, so no results are displayed on the example)
Live Demonstration (a font would be good too)

I already have a forked version of Beautiful Jekyll with this, so I could also submit a PR.

@daattali
Copy link
Owner

Thanks for the suggestion Ethan. It's definitely a nice feature, but I generally try to avoid feature creep and keep the theme simple. If this feature can be incorporated with minimal changes and is very simple for the user to turn on/off - eg. by simply switching a config parameter, then I'd be happy to merge

@ghost
Copy link
Author

ghost commented Jan 29, 2021

My strategy was to create "search.html" in includes, then include it in the home layout if post_search: true in _config.yml.
(PR: #771)

@ghost ghost mentioned this issue Jan 29, 2021
@daattali
Copy link
Owner

Done in commit 950c341

I added a search button to the navbar so that the search will be available on every page and so that it will work even for people who don't use the default layout: home homepage, and so that it doesn't take up space in the middle of the page (it didn't seem right to me)

On large screens there's a magnifying glass icon at the end of the navbar:

image

On smaller screens with the collapsible menu, that button says "Search":

image

In both cases, an overlay is created that can be closed either by clicking the X button inside the input or the Escape key on the keyboard:

image

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

No branches or pull requests

1 participant