mirror of
https://github.com/kremalicious/blog.git
synced 2024-11-22 09:56:51 +01:00
fix search
This commit is contained in:
parent
c42ee85069
commit
5bb2f30f21
@ -111,7 +111,7 @@ module.exports = function(grunt){
|
||||
'bower_components/jquery-infinite-scroll/jquery.infinitescroll.js',
|
||||
'bower_components/masonry/dist/masonry.pkgd.js',
|
||||
'bower_components/imagesloaded/imagesloaded.js',
|
||||
'bower_components/simpleJekyllSearch/index.js',
|
||||
'bower_components/simple-jekyll-search/dest/jekyll-search.js',
|
||||
'bower_components/jquery.adaptive-background/index.js',
|
||||
'<%= config.src %>/<%= config.assets.js %>/app.js'
|
||||
]
|
||||
|
@ -26,13 +26,21 @@ var siteNavigation = {
|
||||
$searchlink.click(function(e){
|
||||
e.preventDefault();
|
||||
|
||||
SimpleJekyllSearch.init({
|
||||
searchInput: $searchfield,
|
||||
resultsContainer: $searchresults,
|
||||
dataSource: '/search.json',
|
||||
searchResultTemplate: '<a class="search-link" href="{url}" title="{title}">{title}</a>',
|
||||
fuzzy: true
|
||||
})
|
||||
|
||||
// init jekyll search
|
||||
$searchfield.jekyllSearch({
|
||||
searchResults : $searchresults,
|
||||
searchResultsTitle : '',
|
||||
template : '<a class="search-link" href="{url}" title="{title}">{title}</a>',
|
||||
fuzzy : true
|
||||
});
|
||||
// $searchfield.jekyllSearch({
|
||||
// searchResults : $searchresults,
|
||||
// searchResultsTitle : '',
|
||||
// template : '<a class="search-link" href="{url}" title="{title}">{title}</a>',
|
||||
// fuzzy : true
|
||||
// });
|
||||
|
||||
// show search
|
||||
$searcharea.removeClass('ready bounceOutUp').addClass('ready slideDown');
|
||||
|
@ -1,14 +1,15 @@
|
||||
---
|
||||
layout: none
|
||||
---
|
||||
[
|
||||
{% for post in site.posts %}
|
||||
{
|
||||
"title" : "{{ post.title | escape | titlecase }}",
|
||||
"category" : "{{ post.categories }}",
|
||||
"tag" : "{{ post.tags }}",
|
||||
"url" : "{{ post.url }}",
|
||||
"tag" : "{{ post.tags | join: ', ' }}",
|
||||
"url" : "{{ site.url }}{{ post.url }}",
|
||||
"date" : "{{ post.date }}",
|
||||
"content" : "{{ post.content | strip_html | strip_newlines | escape }}"
|
||||
} {% if forloop.last %}{% else %},{% endif %}
|
||||
} {% unless forloop.last %},{% endunless %}
|
||||
{% endfor %}
|
||||
]
|
@ -15,7 +15,7 @@
|
||||
"masonry": ">=3.1.5",
|
||||
"imagesloaded": ">=3.1.0",
|
||||
"jquery-infinite-scroll": ">=2.0.2",
|
||||
"simpleJekyllSearch": "https://raw.github.com/christian-fei/Simple-Jekyll-Search/master/jekyll-search.jquery.js",
|
||||
"simple-jekyll-search": ">=1.0.2",
|
||||
"jquery.adaptive-background": "https://raw.github.com/briangonzalez/jquery.adaptive-backgrounds.js/master/src/jquery.adaptive-backgrounds.js"
|
||||
},
|
||||
"ignore": [
|
||||
@ -24,7 +24,5 @@
|
||||
"bower_components",
|
||||
"test",
|
||||
"tests"
|
||||
],
|
||||
"devDependencies": {
|
||||
}
|
||||
]
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user