jekyll-theme-yat icon indicating copy to clipboard operation
jekyll-theme-yat copied to clipboard

Search page / Search box for the Theme

Open MarkChenYutian opened this issue 4 years ago • 11 comments

This theme looks really great! However, it will be better if there is a search box for the theme.

In another Jekyll site I maintained (with ~100 posts) , I used a Jekyll plugin called Simple-Jekyll-Search and it works great. However, as I am not familiar with either Sass or UI design, I am not able to add a search page with corresponding style and create a PR on my own.

Is it possible to add search box and develop a set of style corresponding to the theme in the near future? That will be a great help, thanks!

MarkChenYutian avatar May 02 '21 15:05 MarkChenYutian

If it helps, here's a demo for Simple-Jekyll-Search on the Jekyll site I maintained. https://gwcompsci.gitee.io/secondary-pages/2021/04/12/Search.html

MarkChenYutian avatar May 02 '21 15:05 MarkChenYutian

Hi @MarkChenYutian

Thanks for the issue, but currently I am busy, actually, this feature is on my plan, I will try to add this feature as soon as possible.

Thanks and regards

jeffreytse avatar May 02 '21 15:05 jeffreytse

I implement a Search Box (Elasticsearch) for Yat Theme based on the work: https://blog.omc.io/elasticsearch-for-jekyll-part-1-ab456ac7c093. It should be easy to apply to the blogs that are using default Yet Theme. The demo: https://alexzhangs.github.io The code: https://github.com/alexzhangs/alexzhangs.github.io

@jeffreytse If you would like, I could open a pull request, minor change on the configuration and documentation would be needed of cause.

alexzhangs avatar Oct 17 '21 13:10 alexzhangs

Hi @alexzhangs

You're very welcome to contribute to this project, I will cooperate with you on this Elasticsearch function.

Thanks and Regards

jeffreytse avatar Oct 17 '21 13:10 jeffreytse

@jeffreytse

A branch is created with initial commits (not complete) at: https://github.com/alexforks/jekyll-theme-yat/tree/elasticsearch

Would you create a new branch for jeffreytse/jekyll-theme-yat, then I can open pull request upon it. The changes I've made so far are not complete:

  1. The search UI is built with Searchkit by using webpack, the output will be a .js file. Is it possible to handle this process at the Jekyll plugin level? Or just pre-package this .js file to the theme plugin. This impacts how the Elasticsearch credential with readonly permission will be handled.
  2. A new gem dependency is introduced: Searchyll, and it's not referring to the official Gem, a repo branch is used instead. How to handle this with plugin?
  3. No documenting yet.

alexzhangs avatar Oct 17 '21 17:10 alexzhangs

Hi @alexzhangs

I'm not very satisfied with this solution, especially we need to add another gem to this theme. Instead, I prefer to add a new processor called search-processor to jekyll-spaceship plugin to implement the Elasticsearch feature, what's your opinion?

Thanks and Regards

jeffreytse avatar Oct 18 '21 05:10 jeffreytse

Hi @jeffreytse

It sounds like a good idea. I'm not a ruby guy, and am not experienced with any Jekyll plugin before. Making the search box a part of Yat Theme is not so far to me, but to be a processor of Jekyll-spaceship you may want to construct the framework code. And let me know if there's any point I may help. I can push the code to a feature branch, then you may move forward from there, If there's anything I may provide I'll go there too.

A heads up on two things:

  1. Searchyll relies on a set of config site.elasticsearch, not sure how this part will be handled with spaceship config together. But if there's problem to handle it's no harm to leave it alone, since it's only for the indexing stage, and has a pretty much clean boundary with the search UI.
  2. The layout and the style might be a pain point to fit not only Yet Theme since it's an universal plugin.

Thank you for the brilliant works, I like Yat Theme very much, for both the theme style and the code itself.

alexzhangs avatar Oct 18 '21 07:10 alexzhangs

Hi @alexzhangs

Firstly, thanks for your idea and opinion, I will draft the solution with jekyll-spaceship, and it certainly will be considerate about the compatibility with other Jekyll themes. If I got any progress, I will let you know.

Thanks and Regards

jeffreytse avatar Oct 18 '21 07:10 jeffreytse

@jeffreytse

Yeah! An universal search box would be very welcome to the Jekyll world. The Searchkit webpack components are pushed to the branch, that would be all you may started on. Thanks for all your contributions, you made a better world. 🚀

alexzhangs avatar Oct 18 '21 08:10 alexzhangs

any plan to do this? or some suggestions? Thanks!

wenlai-lavine avatar May 31 '22 20:05 wenlai-lavine

Hi @lavine-lmu

I'm quite busy recently, but welcome you to do any contribution.

Thanks & Regards

jeffreytse avatar Jun 02 '22 03:06 jeffreytse