Skip to content
This repository has been archived by the owner on Sep 7, 2020. It is now read-only.

Add Search capabilities #142

Closed
MoOx opened this issue Feb 14, 2016 · 15 comments
Closed

Add Search capabilities #142

MoOx opened this issue Feb 14, 2016 · 15 comments
Assignees

Comments

@MoOx
Copy link
Owner

MoOx commented Feb 14, 2016

Should be very easy since we have collections to search in all meta (title, tags etc) - but not in body of the posts.
Maybe agolia can help for the body (ref putaindecode/putaindecode.io#535)

@thangngoc89
Copy link
Contributor

This is interesting. We can make a different md-collection-loader for generating data and feed it with algolia

@MoOx
Copy link
Owner Author

MoOx commented Feb 14, 2016 via email

@thangngoc89
Copy link
Contributor

How about a different loader or maybe a new package (like a plugin) ?

@thangngoc89
Copy link
Contributor

I think this should not be in the core. This belongs to a plugin. Already done this. See https://github.com/thangngoc89/blog/blob/aa40e1b710c06112006ac175972338467adb56b3/web_modules/utils/statinamic-agolia-plugin.js

Generate feed should be done this way too. No need for debounce trick (faster markdown build)

poke @MoOx

@thangngoc89
Copy link
Contributor

@MoOx
Copy link
Owner Author

MoOx commented Mar 31, 2016

Also interesting http://lunrjs.com/

@thangngoc89
Copy link
Contributor

This is what it takes to add agolia to a Statinamic site

daynhauhoc/blog@21b07d8

Demo: http://blog.daynhauhoc.com/

@MoOx
Copy link
Owner Author

MoOx commented Apr 27, 2016

ETA?

@thangngoc89
Copy link
Contributor

Lunr.js or algolia ? Or a simple component that search collection ?

@MoOx
Copy link
Owner Author

MoOx commented Apr 28, 2016

We might offer the choice during setup and/or have the simplest solution (without third-party) and offer a doc to add another solution.

bcoe pushed a commit to istanbuljs/istanbuljs.github.io that referenced this issue Aug 31, 2016
…bpack) (#13)

According to #1, you were looking for a nice platform to make a website.
Jekyll is imo outdated. The HTML approach has its benefit, but also a
lot of downside.
And since istanbul/nyc are JavaScript project, what about making this
website with JavaScript? @kentcdodds said everything I think here
#1 (comment)
-233218919

So here is a commit to replace Jekyll by Phenomic. Why Phenomic?
Here is my answer :)
#1 (comment)
-233230716

Here is a “Getting Started” page that might help you starting with
Phenomic https://phenomic.io/docs/getting-started/.

If there is not enough things, feel free to reach us on the community
chat https://gitter.im/MoOx/phenomic

## Benefits

- Modern JavaScript (Babel) and CSS (PostCSS + cssnext)
- Webpack: all assets are tracked. No missing background image or
things like that.
- Component approach thanks to React. You build your website with lego
blocks.
- CSS Modules. No more global styles! (well there is some but just a
bit)
- Awesome developer/writer experience: HOT LOADING (no full page
refresh needed, just work on a file and save it: BOOM auto partial
reload!)
- Client side navigation when JS is on: no full page refresh! (If JS is
off, no problem, HTML pages are generated during deploy)

### Possibilities

- OFFLINE support. You can offer offline via AppCache (legacy solution)
or ServiceWorker (require HTTPS). Latest is recommended and can be
activated via a flag
-Live search (sort of built-in will be added soon, feel free to track
MoOx/phenomic#142 - it’s already possible,
but require some boilerplate - some people already implemented it on
their websites)

## Minor changes (that can be reverted/changed anyway)

- Tutorials are not “posts”, but real simple pages
- Website is now responsive :)
- Phenomic default boilerplate provide system font, which I think is a
good thing https://medium.design/system-shock-6b1dc6d6596f#.yupv0c7mu
- Reference to Phenomic in the footer
- I added a link to github org in the header, I found this was missing
- I added a Blog section in the header, hidden on production for now
since blog entries are dumb :)

## Downside

- No native integration with Github Pages, so you will need to follow
some instructions to setup auto deploy via Travis (don’t worry, this is
very easy https://phenomic.io/docs/usage/gh-pages/)
@thangngoc89 thangngoc89 self-assigned this Sep 17, 2016
@thangngoc89
Copy link
Contributor

I'm on it.

TODO:

  • Build index
  • Reduce api requests to Algolia on each build by hashing the page content and only send changed page.

Resources:

Example record

{
    "h1": "Validation", 
    "h2": "Working With Error Messages", 
    "h3": "Custom Error Messages", 
    "link": "validation#custom-error-messages", 
    "content": "If needed, you may use custom error messages for validation instead of the defaults. There are several ways to specify custom messages. First, you may pass the custom messages as the third argument to the `Validator::make` method:", 
    "importance": 6, 
    "_tags": [
        "5.1"
    ], 
    "objectID": "5.1-validation#custom-error-messages-380c9827712413dbe75b5db515cd3e59"
}

@thangngoc89
Copy link
Contributor

thangngoc89 commented Sep 20, 2016

Algoliasearch jekyll added a lazy_update feature the reduce the number of api calls to Algolia algolia/algoliasearch-jekyll@16e7b74

@MoOx
Copy link
Owner Author

MoOx commented Nov 10, 2016

This might also be interesting to check out http://fusejs.io/

@MoOx MoOx changed the title Add a search input Add Search capabilities Nov 10, 2016
@bloodyowl
Copy link
Contributor

Considering doing a plugin for this

@MoOx
Copy link
Owner Author

MoOx commented Nov 26, 2018

Will revisit this idea later.

@MoOx MoOx closed this as completed Nov 26, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants