Comments (15)
As you wish. This is totally bad practice.
from simple-jekyll-search.
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.
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.
@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.
starting from here I got to horsey: https://www.npmjs.com/package/fuzzysearch
from simple-jekyll-search.
gonna close this for now @XhmikosR
from simple-jekyll-search.
Please reopen this. It's a valid request.
from simple-jekyll-search.
@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.
@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.
@XhmikosR if you want you can do a PR so that we can merge the new option
from simple-jekyll-search.
You know I'd do it, but limited time. The request is valid though.
from simple-jekyll-search.
Was this implemented?
from simple-jekyll-search.
nope, just cleaning up old issues
from simple-jekyll-search.
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.
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)
- Is it possible to redirect the search button to a new page? HOT 3
- Can we add custom fields to search.json? HOT 2
- Unexpected token in JSON at position 892 at JSON.parse HOT 1
- Doesn't like double quotes in code highlighter HOT 1
- SimpleJekyllSearch --- failed to get JSON (/search.json) HOT 10
- Could I trigger a search by modifying the Element value? HOT 1
- How can I know the json has been loaded HOT 4
- Callback when search results are displayed HOT 2
- switch mit license to GPL?
- Why my export zip file is 0 size?
- Search by entire phrase? HOT 3
- is't support search content. only support title HOT 6
- Code snippet breaking SimpleJekyllSearch HOT 1
- Use with GitHub Pages? HOT 3
- Highlight searched word in results
- Stating default options in README
- BUG: “Uncaught TypeError: str.trim is not a function”
- BUG: Uncaugnt TypeError: e.trim is not a function
- Missing tag for v1.10.0
- Error: SimpleJekyllSearch --- failed to get JSON (/search.json)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from simple-jekyll-search.