Giter VIP home page Giter VIP logo

Comments (15)

XhmikosR avatar XhmikosR commented on May 24, 2024 1

As you wish. This is totally bad practice.

from simple-jekyll-search.

christian-fei avatar christian-fei commented on May 24, 2024

I think it's useful to have the json file loaded on page load, since it's so small, and the intention is to use the search right away, not to wait and then to search. (probably in the meantime I would have already forgotten what I was looking for)

:)

wdyt?

from simple-jekyll-search.

XhmikosR avatar XhmikosR commented on May 24, 2024

Well, as you say, if it's small, then you wouldn't have to wait, after you enter the search form. So why penalize every visitor even if they don't intend to search?

Also, the json can become pretty big, so this saves time from the initial page load.

from simple-jekyll-search.

christian-fei avatar christian-fei commented on May 24, 2024

@XhmikosR good point.

I just found https://bevacqua.github.io/horsey/ which actually has implemented what we are looking for.
Maybe we could take a look and take inspiration from there

from simple-jekyll-search.

christian-fei avatar christian-fei commented on May 24, 2024

starting from here I got to horsey: https://www.npmjs.com/package/fuzzysearch

from simple-jekyll-search.

christian-fei avatar christian-fei commented on May 24, 2024

gonna close this for now @XhmikosR

from simple-jekyll-search.

XhmikosR avatar XhmikosR commented on May 24, 2024

Please reopen this. It's a valid request.

from simple-jekyll-search.

biocross avatar biocross commented on May 24, 2024

@XhmikosR You can always do something like this, in which you can load the JSON yourself on demand, and then initialise search:

$.getJSON("/search.json", function (data) {
            SimpleJekyllSearch({
                searchInput: document.querySelector('#search-input'),
                resultsContainer: document.querySelector('.post-list'),
                json: data,
                searchResultTemplate: template
            });
        });

I'm using jQuery AJAX to load the JSON in this code, but plain JS will work just as well.

from simple-jekyll-search.

XhmikosR avatar XhmikosR commented on May 24, 2024

@biocross: I'm aware how I can achieve this myself. My point is, this should be a baked in option, because it improves performance.

from simple-jekyll-search.

christian-fei avatar christian-fei commented on May 24, 2024

@XhmikosR if you want you can do a PR so that we can merge the new option

from simple-jekyll-search.

XhmikosR avatar XhmikosR commented on May 24, 2024

You know I'd do it, but limited time. The request is valid though.

from simple-jekyll-search.

XhmikosR avatar XhmikosR commented on May 24, 2024

Was this implemented?

from simple-jekyll-search.

christian-fei avatar christian-fei commented on May 24, 2024

nope, just cleaning up old issues

from simple-jekyll-search.

XhmikosR avatar XhmikosR commented on May 24, 2024

Well, I'm all for that, but this is a valid request. Just keep it open, it doesn't hurt anyone.

from simple-jekyll-search.

christian-fei avatar christian-fei commented on May 24, 2024

Since it's a request, we would need a PR. The discussion was interesting on this issue, but i don't think this is really a blocking issue.
The search.json file is loaded async, is relatively small, and in my opinion it is fine to close the issue

I archived it since it's been months nobody was "burdened" by this issue.

I am open for future PRs, or even rewrites

from simple-jekyll-search.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.