Add support for Lunr and Algolia search (#48)

* Add basic support for Lunr and Algolia search
* Fix skip links
* Fix URL paths
* Add toggle for Algolia "powered by" badge
* Improve placement of search toggle
* Fix search icon fill color
* Add search documentation
* Update CHANGELOG
* Enable search on demo site
* Update TOC
This commit is contained in:
Michael Rose 2018-02-16 09:46:51 -05:00 committed by GitHub
parent 6d43c0f0f4
commit e94ea30ffd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
42 changed files with 826 additions and 44 deletions

View File

@ -7,8 +7,16 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
## Unreleased
### Added
- Add site-wide search toggle.
- Add support for Lunr search. [#48](https://github.com/mmistakes/jekyll-theme-basically-basic/pull/48)
- Add support for Algolia search. [#48](https://github.com/mmistakes/jekyll-theme-basically-basic/pull/48)
### Changed
- New installation and upgrade instructions.
- Absolutely position navigation menu instead of sticking it to the top.
- Visually hide "Menu" label.
- Improve alignment of menu toggle when search is enabled.
### Fixed
- Fix `border-bottom` for Gist line numbers.

View File

@ -42,10 +42,13 @@ with a few enhancements thrown in for good measure:
3. [Text](#text)
4. [Navigation](#navigation)
5. [Pagination](#pagination)
6. [Author](#author)
7. [Reading Time](#reading-time)
8. [Comments (via Disqus)](#comments-via-disqus)
9. [Google Analytics](#google-analytics)
6. [Search](#search)
1. [Lunr (default)](#lunr-default)
2. [Algolia](#algolia)
7. [Author](#author)
8. [Reading Time](#reading-time)
9. [Comments (via Disqus)](#comments-via-disqus)
10. [Google Analytics](#google-analytics)
5. [Layouts](#layouts)
1. [`layout: default`](#layout-default)
2. [`layout: post`](#layout-post)
@ -63,9 +66,6 @@ with a few enhancements thrown in for good measure:
8. [Contributing](#contributing)
1. [Pull Requests](#pull-requests)
9. [Credits](#credits)
1. [Creator](#creator)
2. [Icons + Demo Images:](#icons--demo-images)
3. [Other:](#other)
10. [License](#license)
## Installation
@ -402,6 +402,67 @@ add the following front matter:
paginate: true
```
### Search
To enable site-wide search add `search: true` to your `_config.yml`.
#### Lunr (default)
The default search uses [**Lunr**](https://lunrjs.com/) to build a search index of all your documents. This method is 100% compatible with sites hosted on GitHub Pages.
**Note:** Only the first 50 words of a post or page's body content is added to the Lunr search index. Setting `search_full_content` to `true` in your `_config.yml` will override this and could impact page load performance.
#### Algolia
For faster and more relevant search:
1. Add the [`jekyll-algolia`](https://github.com/algolia/jekyll-algolia) gem to your `Gemfile`, in the `:jekyll_plugins` section.
```ruby
group :jekyll_plugins do
gem "jekyll-feed"
gem "jekyll-seo-tag"
gem "jekyll-sitemap"
gem "jekyll-paginate"
gem "jekyll-algolia"
end
```
Once this is done, download all dependencies by running `bundle install`.
2. Switch search providers from `lunr` to `algolia` in your `_config.yml` file:
```yaml
search_provider: algolia
```
3. Add the following Algolia credentials to your `_config.yml` file. *If you don't have an Algolia account, you can open a free [Community plan](https://www.algolia.com/users/sign_up/hacker). Once signed in, you can grab your credentials from [your dashboard](https://www.algolia.com/licensing).*
```yaml
algolia:
application_id: # YOUR_APPLICATION_ID
index_name: # YOUR_INDEX_NAME
search_only_api_key: # YOUR_SEARCH_ONLY_API_KEY
powered_by: # true (default), false
```
4. Once your credentials are setup, you can run the indexing with the following command:
```
ALGOLIA_API_KEY=your_admin_api_key bundle exec jekyll algolia
```
For Windows users you will have to use `set` to assigned the `ALGOLIA_API_KEY` environment variable.
```
set ALGOLIA_API_KEY=your_admin_api_key
bundle exec jekyll algolia
```
Note that `ALGOLIA_API_KEY` should be set to your admin API key.
To use the Algolia search with GitHub Pages hosted sites follow [this deployment guide](https://community.algolia.com/jekyll-algolia/github-pages.html). Or this guide for [deploying on Netlify](https://community.algolia.com/jekyll-algolia/netlify.html).
### Author
Author information is used as meta data for post "by lines" and propagates the

View File

@ -26,6 +26,14 @@ author:
twitter_username:
github_username:
logo: # path of site logo, e.g. "/assets/images/logo.png"
search: # true, false (default)
search_full_content: false # true, false (default)
search_provider: # lunr (default), algolia
algolia:
application_id: # YOUR_APPLICATION_ID
index_name: # YOUR_INDEX_NAME
search_only_api_key: # YOUR_SEARCH_ONLY_API_KEY
powered_by: # true (default), false
# Build settings
markdown: kramdown

View File

@ -8,6 +8,9 @@ t:
skip_content: "Skip to content"
skip_footer: "Skip to footer"
menu: "Menu"
search: "Search"
results_found: "Result(s) found"
search_placeholder_text: "Enter your search term..."
home: "Home"
newer: "Newer"
older: "Older"

View File

@ -2,4 +2,15 @@
{% include google-analytics.html %}
{% endif %}
<script src="https://code.jquery.com/jquery-3.3.1.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
<script async src="{{ '/assets/javascripts/main.js' | relative_url }}"></script>
{% if site.search %}
{%- assign search_provider = site.search_provider | default: "lunr" -%}
{%- case search_provider -%}
{%- when "lunr" -%}
{% include search/lunr-search-scripts.html %}
{%- when "algolia" -%}
{% include search/algolia-search-scripts.html %}
{%- endcase -%}
{% endif %}

View File

@ -0,0 +1,13 @@
<div class="inner">
{% if site.search %}
{%- assign search_provider = site.search_provider | default: "lunr" -%}
{%- case search_provider -%}
{%- when "lunr" -%}
<input type="text" id="search" class="search-input" tabindex="-1" placeholder="{{ site.data.theme.t.menu.search_placeholder_text | default: 'Enter your search term...' }}" />
<div id="results" class="results"></div>
{%- when "algolia" -%}
<div tabindex="-1" class="search-searchbar"></div>
<div class="search-hits"></div>
{%- endcase -%}
{% endif %}
</div>

View File

@ -0,0 +1,52 @@
<!-- Including InstantSearch.js library and styling -->
<script src="https://cdn.jsdelivr.net/npm/instantsearch.js@2.3.3/dist/instantsearch.min.js"></script>
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/instantsearch.js@2.3.3/dist/instantsearch.min.css">
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/instantsearch.js@2.3.3/dist/instantsearch-theme-algolia.min.css">
<script>
// Instanciating InstantSearch.js with Algolia credentials
const search = instantsearch({
appId: '{{ site.algolia.application_id }}',
apiKey: '{{ site.algolia.search_only_api_key }}',
indexName: '{{ site.algolia.index_name }}',
searchParameters: {
restrictSearchableAttributes: [
'title',
'content'
]
}
});
const hitTemplate = function(hit) {
const url = hit.url;
const title = hit._highlightResult.title.value;
const content = hit._highlightResult.html.value;
return `
<article class="entry">
<h3 class="entry-title"><a href="{{ site.baseurl }}${url}">${title}</a></h3>
<div class="entry-excerpt">${content}</div>
</article>
`;
}
// Adding searchbar and results widgets
search.addWidget(
instantsearch.widgets.searchBox({
container: '.search-searchbar',
{% unless site.algolia.powered_by == false %}poweredBy: true,{% endunless %}
placeholder: '{{ site.data.theme.t.menu.search_placeholder_text | default: "Enter your search term..." }}'
})
);
search.addWidget(
instantsearch.widgets.hits({
container: '.search-hits',
templates: {
item: hitTemplate
}
})
);
// Starting the search
search.start();
</script>

View File

@ -0,0 +1,106 @@
{%- assign lang = site.lang | slice: 0, 2 | default: "en" -%}
{%- case lang -%}
{%- when "da" -%}
{%- assign lang = "da" -%}
{%- when "de" -%}
{%- assign lang = "de" -%}
{%- when "du" -%}
{%- assign lang = "du" -%}
{-% when "es" -%}
{%- assign lang = "es" -%}
{%- when "fi" -%}
{%- assign lang = "fi" -%}
{%- when "fr" -%}
{%- assign lang = "fr" -%}
{%- when "hu" -%}
{%- assign lang = "hu" -%}
{%- when "it" -%}
{%- assign lang = "it" -%}
{%- when "ja" -%}
{%- assign lang = "ja" -%}
{%- when "jp" -%}
{%- assign lang = "jp" -%}
{%- when "no" -%}
{%- assign lang = "no" -%}
{%- when "pt" -%}
{%- assign lang = "pt" -%}
{%- when "ro" -%}
{%- assign lang = "ro" -%}
{%- when "ru" -%}
{%- assign lang = "ru" -%}
{%- when "sv" -%}
{%- assign lang = "sv" -%}
{%- when "tr" -%}
{%- assign lang = "tr" -%}
{%- else -%}
{%- assign lang = "en" -%}
{%- endcase -%}
<script src="{{ '/assets/javascripts/lunr/lunr.min.js' | absolute_url }}"></script>
<script src="{{ '/assets/javascripts/search-data.json' | absolute_url }}"></script>
{%- unless lang == "en" -%}
<script src="{{ '/assets/javascripts/lunr/lunr.stemmer.support.min.js' | absolute_url }}"></script>
<script src="{{ '/assets/javascripts/lunr/lunr.' | append: lang | append: '.min.js' | absolute_url }}"></script>
{%- endunless %}
<script>
var idx = lunr(function () {
{% unless lang == "en" %}
// use the language
this.use(lunr.{{ lang }});
{% endunless %}
// the, the normal lunr index initialization
this.field('title')
this.field('excerpt')
this.field('categories')
this.field('tags')
this.ref('id')
this.pipeline.remove(lunr.trimmer)
// add documents to index
for (var item in store) {
this.add({
title: store[item].title,
excerpt: store[item].excerpt,
categories: store[item].categories,
tags: store[item].tags,
id: item
})
}
});
console.log(jQuery.type(idx));
$(document).ready(function () {
$('input#search').on('keyup', function () {
var resultdiv = $('#results');
var query = $(this).val().toLowerCase();
var result =
idx.query(function (q) {
query.split(lunr.tokenizer.separator).forEach(function (term) {
q.term(term, { boost: 100 })
if (query.lastIndexOf(" ") != query.length - 1) {
q.term(term, { usePipeline: false, wildcard: lunr.Query.wildcard.TRAILING, boost: 10 })
}
if (term != "") {
q.term(term, { usePipeline: false, editDistance: 1, boost: 1 })
}
})
});
resultdiv.empty();
resultdiv.prepend('<p class="results-found">' + result.length + ' {{ site.data.theme.t.menu.results_found | default: "Result(s) found" }}</p>');
for (var item in result) {
var ref = result[item].ref;
var searchitem =
'<article class="entry">' +
'<h3 class="entry-title">' +
'<a href="' + store[ref].url + '">' + store[ref].title + '</a>' +
'</h3>' +
'<div class="entry-excerpt">' +
'<p>' + store[ref].excerpt.split(" ").splice(0, 20).join(" ") + '...</p>' +
'</div>' +
'</article>';
resultdiv.append(searchitem);
}
});
});
</script>

View File

@ -13,9 +13,18 @@
{% include skip-links.html %}
<div class="sidebar-toggle-wrapper">
{% if site.search %}
<button class="search-toggle" type="button">
<svg class="icon" width="16" height="16" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15.99 16">
<title>{{ site.data.theme.t.search | default: 'Search' }}</title>
<path d="M15.5,13.12L13.19,10.8a1.69,1.69,0,0,0-1.28-.55l-0.06-.06A6.5,6.5,0,0,0,5.77,0,6.5,6.5,0,0,0,2.46,11.59a6.47,6.47,0,0,0,7.74.26l0.05,0.05a1.65,1.65,0,0,0,.5,1.24l2.38,2.38A1.68,1.68,0,0,0,15.5,13.12ZM6.4,2A4.41,4.41,0,1,1,2,6.4,4.43,4.43,0,0,1,6.4,2Z" transform="translate(-.01)"></path>
</svg>
</button>
{% endif %}
<button class="toggle navicon-button larr" type="button">
<span class="toggle-inner">
<span class="sidebar-toggle-label">{{ site.data.theme.t.menu | default: 'Menu' }}</span>
<span class="sidebar-toggle-label visually-hidden">{{ site.data.theme.t.menu | default: 'Menu' }}</span>
<span class="navicon"></span>
</span>
</button>
@ -31,7 +40,13 @@
<div class="canvas">
<div class="wrapper">
{% include masthead.html %}
{{ content }}
<div class="initial-content">
{{ content }}
</div>
<div class="search-content">
{% include search-form.html %}
</div>
</div>
</div>

View File

@ -22,6 +22,7 @@
@import "basically-basic/global";
@import "basically-basic/sidebar";
@import "basically-basic/navigation";
@import "basically-basic/search";
@import "basically-basic/footer";
@import "basically-basic/entries";
@import "basically-basic/buttons";

View File

@ -111,8 +111,8 @@ a {
}
}
*:focus {
border-color: $accent-color;
outline: none;
box-shadow: 0 0 10px $accent-color;
}
// *:focus {
// border-color: $accent-color;
// outline: none;
// box-shadow: 0 0 10px $accent-color;
// }

View File

@ -6,7 +6,9 @@
@include fluid-type($min-vw, $max-vw, 20px, 24px);
margin: 0;
padding: 1.8125rem 1rem;
padding-right: calc(10vw + #{$navicon-width}); /* make room for sidebar toggle */
padding-right: calc(
10vw + (2 * #{$navicon-width})
); /* make room for sidebar toggle */
font-family: $base-font-family;
font-weight: bold;
line-height: 1;
@ -21,8 +23,10 @@
a {
display: -ms-flexbox;
display: -webkit-box;
display: flex;
-ms-flex-align: center;
-webkit-box-align: center;
align-items: center;
min-height: $site-image-height;
color: $text-color;

View File

@ -5,8 +5,9 @@
.navicon-button {
display: inline-block;
position: relative;
margin: 0.90625rem 0;
padding: 0.90625rem 1rem;
padding: 0.90625rem 0;
min-height: $site-image-height;
-webkit-transition: $navicon-duration / 2;
transition: $navicon-duration / 2;
border: 0;
outline: none;
@ -18,33 +19,32 @@
-webkit-user-select: none;
user-select: none;
@include breakpoint($medium) {
margin-right: 2rem;
}
@include breakpoint($large) {
margin-right: 5vw;
}
&.open {
background-color: $navicon-nav-bg-open;
}
.navicon::before,
.navicon::after {
-webkit-transition-duration: $navicon-duration / 2;
transition-duration: $navicon-duration / 2;
}
&:hover {
-webkit-transition-duration: $navicon-duration;
transition-duration: $navicon-duration;
.navicon::before,
.navicon::after {
-webkit-transition-duration: $navicon-duration / 2;
transition-duration: $navicon-duration / 2;
}
.navicon::before { top: (2.5 * $navicon-height); }
.navicon::after { top: (-2.5 * $navicon-height); }
.navicon::before {
top: (2.5 * $navicon-height);
}
.navicon::after {
top: (-2.5 * $navicon-height);
}
}
}
@ -52,6 +52,7 @@
position: relative;
width: $navicon-width;
height: $navicon-height;
-webkit-transition-duration: $navicon-duration;
transition-duration: $navicon-duration;
border-radius: $navicon-width;
background: $navicon-content-bg;
@ -62,14 +63,19 @@
position: absolute;
width: $navicon-width;
height: $navicon-height;
-webkit-transition-duration: $navicon-duration $navicon-duration / 2;
transition-duration: $navicon-duration $navicon-duration / 2;
border-radius: $navicon-width;
background: $navicon-content-bg;
content: '';
content: "";
}
&::before { top: (2 * $navicon-height); }
&::after { top: (-2 * $navicon-height); }
&::before {
top: (2 * $navicon-height);
}
&::after {
top: (-2 * $navicon-height);
}
}
.open:not(.steps) .navicon::before,
@ -78,10 +84,13 @@
}
.open {
-webkit-transform: scale($navicon-toggled-size);
-ms-transform: scale($navicon-toggled-size);
transform: scale($navicon-toggled-size);
.navicon::before,
.navicon::after {
-webkit-transition-duration: $navicon-duration;
transition-duration: $navicon-duration;
}
@ -89,36 +98,50 @@
&.larr .navicon,
&.rarr .navicon,
&.uarr .navicon {
&::before,
&::after {
width: (0.6 * $navicon-width);
}
&::before {
-webkit-transform: rotate(35deg);
-ms-transform: rotate(35deg);
transform: rotate(35deg);
-webkit-transform-origin: left top;
-ms-transform-origin: left top;
transform-origin: left top;
}
&::after {
-webkit-transform: rotate(-35deg);
-ms-transform: rotate(-35deg);
transform: rotate(-35deg);
-webkit-transform-origin: left bottom;
-ms-transform-origin: left bottom;
transform-origin: left bottom;
}
}
&.uarr {
-webkit-transform: scale($navicon-toggled-size) rotate(90deg);
-ms-transform: scale($navicon-toggled-size) rotate(90deg);
transform: scale($navicon-toggled-size) rotate(90deg);
}
&.rarr .navicon {
&::before {
-webkit-transform: translate3d(1em, 0, 0) rotate(-35deg);
transform: translate3d(1em, 0, 0) rotate(-35deg);
-webkit-transform-origin: right top;
-ms-transform-origin: right top;
transform-origin: right top;
}
&::after {
-webkit-transform: translate3d(1em, 0, 0) rotate(35deg);
transform: translate3d(1em, 0, 0) rotate(35deg);
-webkit-transform-origin: right bottom;
-ms-transform-origin: right bottom;
transform-origin: right bottom;
}
}

View File

@ -0,0 +1,101 @@
/* ==========================================================================
SEARCH
========================================================================== */
.search-toggle {
margin-left: 1rem;
margin-right: 1rem;
border: 0;
outline: none;
background-color: transparent;
cursor: pointer;
-webkit-transition: 0.2s;
transition: 0.2s;
.icon {
@include fluid-type($min-vw, $max-vw, 20px, 24px);
fill: $navicon-content-bg;
}
}
.search-content {
display: none;
visibility: hidden;
padding-top: 1em;
padding-bottom: 1em;
.inner {
padding: 0 0.5rem;
@include breakpoint($small) {
padding-right: 1rem;
padding-left: 1rem;
}
@include breakpoint($medium) {
padding-right: 2rem;
padding-left: 2rem;
}
@include breakpoint($large) {
padding-right: 3rem;
padding-left: 3rem;
}
@include breakpoint($xlarge) {
padding-right: 4rem;
padding-left: 4rem;
}
}
.entry-excerpt {
p {
margin-bottom: 0;
}
}
.search-input {
display: block;
margin-bottom: 0;
padding: 0;
border: none;
outline: none;
-webkit-box-shadow: none;
box-shadow: none;
background-color: transparent;
@include fluid-type($min-vw, $max-vw, 24px, 32px);
}
&.is--visible::after {
content: "";
display: block;
}
.results-found {
margin-top: 0.5em;
}
}
/* Algolia search */
.ais-hits {
.entry {
border-bottom: 1px solid $border-color;
}
}
.ais-search-box {
max-width: 100% !important;
margin-bottom: 2em;
}
.entry-title .ais-Highlight {
color: $accent-color;
font-style: normal;
text-decoration: underline;
}
.entry-excerpt .ais-Highlight {
color: $accent-color;
font-style: normal;
font-weight: bold;
}

View File

@ -25,11 +25,16 @@
}
li {
-webkit-transform: translateX(-1rem);
-ms-transform: translateX(-1rem);
transform: translateX(-1rem);
-webkit-transition: all 0.5s;
transition: all 0.5s;
opacity: 0;
&.is--moved {
-webkit-transform: translateX(0);
-ms-transform: translateX(0);
transform: translateX(0);
opacity: 1;
}
@ -46,6 +51,7 @@
left: -3rem;
width: 0;
height: 1px;
-webkit-transition: width 0.3s cubic-bezier(0, 0, 0.3, 1);
transition: width 0.3s cubic-bezier(0, 0, 0.3, 1);
background-color: $base-color;
content: "";
@ -67,6 +73,7 @@
padding: 1.5em;
background-color: $sidebar-background-color;
overflow-x: hidden;
-webkit-box-shadow: inset -1em 0 5em 0 rgba(0, 0, 0, 0.125);
box-shadow: inset -1em 0 5em 0 rgba(0, 0, 0, 0.125);
@include breakpoint($medium) {
@ -119,23 +126,40 @@
}
.sidebar-toggle-wrapper {
position: fixed;
top: 0.675rem;
position: absolute;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
top: 0;
right: 0;
cursor: pointer;
margin: 1.8125rem 0;
padding-right: 1rem;
background-color: $background-color;
z-index: 10000;
@include breakpoint($medium) {
right: 2rem;
padding-right: 0;
}
@include breakpoint($large) {
right: 5vw;
}
.toggle-inner {
display: -ms-flexbox;
display: -webkit-box;
display: flex;
-ms-flex-align: center;
-webkit-box-align: center;
align-items: center;
}
}
.sidebar-toggle-label {
-ms-flex-order: 2;
order: 2;
margin-left: 0.5rem;
font-weight: bold;
color: $text-color;

View File

@ -1,5 +1,6 @@
@import 'utilities/accessibility';
@import 'utilities/align';
@import 'utilities/clearfix';
@import 'utilities/float';
@import 'utilities/text';
@import "utilities/accessibility";
@import "utilities/align";
@import "utilities/clearfix";
@import "utilities/float";
@import "utilities/text";
@import "utilities/visibility";

View File

@ -0,0 +1,32 @@
/* ==========================================================================
Visibility
========================================================================== */
/* http://www.456bereastreet.com/archive/200711/screen_readers_sometimes_ignore_displaynone/ */
.is--hidden {
display: none;
visibility: hidden;
}
.is--visible {
display: block;
visibility: visible;
}
/* https://developer.yahoo.com/blogs/ydn/clip-hidden-content-better-accessibility-53456.html */
.visually-hidden {
position: absolute !important;
clip: rect(1px, 1px, 1px, 1px);
height: 1px !important;
width: 1px !important;
border: 0 !important;
overflow: hidden;
}
body:hover .visually-hidden a,
body:hover .visually-hidden input,
body:hover .visually-hidden button {
display: none !important;
}

18
assets/javascripts/lunr/lunr.da.min.js vendored Normal file
View File

@ -0,0 +1,18 @@
/*!
* Lunr languages, `Danish` language
* https://github.com/MihaiValentin/lunr-languages
*
* Copyright 2014, Mihai Valentin
* http://www.mozilla.org/MPL/
*/
/*!
* based on
* Snowball JavaScript Library v0.3
* http://code.google.com/p/urim/
* http://snowball.tartarus.org/
*
* Copyright 2010, Oleg Mazko
* http://www.mozilla.org/MPL/
*/
!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if("undefined"==typeof e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if("undefined"==typeof e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.da=function(){this.pipeline.reset(),this.pipeline.add(e.da.trimmer,e.da.stopWordFilter,e.da.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.da.stemmer))},e.da.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA--",e.da.trimmer=e.trimmerSupport.generateTrimmer(e.da.wordCharacters),e.Pipeline.registerFunction(e.da.trimmer,"trimmer-da"),e.da.stemmer=function(){var r=e.stemmerSupport.Among,i=e.stemmerSupport.SnowballProgram,n=new function(){function e(){var e,r=p.cursor+3;if(d=p.limit,0<=r&&r<=p.limit){for(a=r;;){if(e=p.cursor,p.in_grouping(w,97,248)){p.cursor=e;break}if(p.cursor=e,e>=p.limit)return;p.cursor++}for(;!p.out_grouping(w,97,248);){if(p.cursor>=p.limit)return;p.cursor++}d=p.cursor,d<a&&(d=a)}}function n(){var e,r;if(p.cursor>=d&&(r=p.limit_backward,p.limit_backward=d,p.ket=p.cursor,e=p.find_among_b(c,32),p.limit_backward=r,e))switch(p.bra=p.cursor,e){case 1:p.slice_del();break;case 2:p.in_grouping_b(f,97,229)&&p.slice_del()}}function t(){var e,r=p.limit-p.cursor;p.cursor>=d&&(e=p.limit_backward,p.limit_backward=d,p.ket=p.cursor,p.find_among_b(l,4)?(p.bra=p.cursor,p.limit_backward=e,p.cursor=p.limit-r,p.cursor>p.limit_backward&&(p.cursor--,p.bra=p.cursor,p.slice_del())):p.limit_backward=e)}function s(){var e,r,i,n=p.limit-p.cursor;if(p.ket=p.cursor,p.eq_s_b(2,"st")&&(p.bra=p.cursor,p.eq_s_b(2,"ig")&&p.slice_del()),p.cursor=p.limit-n,p.cursor>=d&&(r=p.limit_backward,p.limit_backward=d,p.ket=p.cursor,e=p.find_among_b(m,5),p.limit_backward=r,e))switch(p.bra=p.cursor,e){case 1:p.slice_del(),i=p.limit-p.cursor,t(),p.cursor=p.limit-i;break;case 2:p.slice_from("løs")}}function o(){var e;p.cursor>=d&&(e=p.limit_backward,p.limit_backward=d,p.ket=p.cursor,p.out_grouping_b(w,97,248)?(p.bra=p.cursor,u=p.slice_to(u),p.limit_backward=e,p.eq_v_b(u)&&p.slice_del()):p.limit_backward=e)}var a,d,u,c=[new r("hed",-1,1),new r("ethed",0,1),new r("ered",-1,1),new r("e",-1,1),new r("erede",3,1),new r("ende",3,1),new r("erende",5,1),new r("ene",3,1),new r("erne",3,1),new r("ere",3,1),new r("en",-1,1),new r("heden",10,1),new r("eren",10,1),new r("er",-1,1),new r("heder",13,1),new r("erer",13,1),new r("s",-1,2),new r("heds",16,1),new r("es",16,1),new r("endes",18,1),new r("erendes",19,1),new r("enes",18,1),new r("ernes",18,1),new r("eres",18,1),new r("ens",16,1),new r("hedens",24,1),new r("erens",24,1),new r("ers",16,1),new r("ets",16,1),new r("erets",28,1),new r("et",-1,1),new r("eret",30,1)],l=[new r("gd",-1,-1),new r("dt",-1,-1),new r("gt",-1,-1),new r("kt",-1,-1)],m=[new r("ig",-1,1),new r("lig",0,1),new r("elig",1,1),new r("els",-1,1),new r("løst",-1,2)],w=[17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,0,48,0,128],f=[239,254,42,3,0,0,0,0,0,0,0,0,0,0,0,0,16],p=new i;this.setCurrent=function(e){p.setCurrent(e)},this.getCurrent=function(){return p.getCurrent()},this.stem=function(){var r=p.cursor;return e(),p.limit_backward=r,p.cursor=p.limit,n(),p.cursor=p.limit,t(),p.cursor=p.limit,s(),p.cursor=p.limit,o(),!0}};return function(e){return"function"==typeof e.update?e.update(function(e){return n.setCurrent(e),n.stem(),n.getCurrent()}):(n.setCurrent(e),n.stem(),n.getCurrent())}}(),e.Pipeline.registerFunction(e.da.stemmer,"stemmer-da"),e.da.stopWordFilter=e.generateStopWordFilter("ad af alle alt anden at blev blive bliver da de dem den denne der deres det dette dig din disse dog du efter eller en end er et for fra ham han hans har havde have hende hendes her hos hun hvad hvis hvor i ikke ind jeg jer jo kunne man mange med meget men mig min mine mit mod ned noget nogle nu når og også om op os over på selv sig sin sine sit skal skulle som sådan thi til ud under var vi vil ville vor være været".split(" ")),e.Pipeline.registerFunction(e.da.stopWordFilter,"stopWordFilter-da")}});

18
assets/javascripts/lunr/lunr.de.min.js vendored Normal file

File diff suppressed because one or more lines are too long

18
assets/javascripts/lunr/lunr.du.min.js vendored Normal file

File diff suppressed because one or more lines are too long

18
assets/javascripts/lunr/lunr.es.min.js vendored Normal file

File diff suppressed because one or more lines are too long

18
assets/javascripts/lunr/lunr.fi.min.js vendored Normal file

File diff suppressed because one or more lines are too long

18
assets/javascripts/lunr/lunr.fr.min.js vendored Normal file

File diff suppressed because one or more lines are too long

18
assets/javascripts/lunr/lunr.hu.min.js vendored Normal file

File diff suppressed because one or more lines are too long

18
assets/javascripts/lunr/lunr.it.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");var r="2"==e.version[0];e.ja=function(){this.pipeline.reset(),this.pipeline.add(e.ja.trimmer,e.ja.stopWordFilter,e.ja.stemmer),r?this.tokenizer=e.ja.tokenizer:(e.tokenizer&&(e.tokenizer=e.ja.tokenizer),this.tokenizerFn&&(this.tokenizerFn=e.ja.tokenizer))};var t=new e.TinySegmenter;e.ja.tokenizer=function(i){var n,o,s,p,a,u,m,l,c,f;if(!arguments.length||null==i||void 0==i)return[];if(Array.isArray(i))return i.map(function(t){return r?new e.Token(t.toLowerCase()):t.toLowerCase()});for(o=i.toString().toLowerCase().replace(/^\s+/,""),n=o.length-1;n>=0;n--)if(/\S/.test(o.charAt(n))){o=o.substring(0,n+1);break}for(a=[],s=o.length,c=0,l=0;c<=s;c++)if(u=o.charAt(c),m=c-l,u.match(/\s/)||c==s){if(m>0)for(p=t.segment(o.slice(l,c)).filter(function(e){return!!e}),f=l,n=0;n<p.length;n++)r?a.push(new e.Token(p[n],{position:[f,p[n].length],index:a.length})):a.push(p[n]),f+=p[n].length;l=c+1}return a},e.ja.stemmer=function(){return function(e){return e}}(),e.Pipeline.registerFunction(e.ja.stemmer,"stemmer-ja"),e.ja.wordCharacters="一二三四五六七八九十百千万億兆一-龠々〆ヵヶぁ-んァ-ヴーア-ン゙a-zA-Z--0-9-",e.ja.trimmer=e.trimmerSupport.generateTrimmer(e.ja.wordCharacters),e.Pipeline.registerFunction(e.ja.trimmer,"trimmer-ja"),e.ja.stopWordFilter=e.generateStopWordFilter("これ それ あれ この その あの ここ そこ あそこ こちら どこ だれ なに なん 何 私 貴方 貴方方 我々 私達 あの人 あのかた 彼女 彼 です あります おります います は が の に を で え から まで より も どの と し それで しかし".split(" ")),e.Pipeline.registerFunction(e.ja.stopWordFilter,"stopWordFilter-ja"),e.jp=e.ja,e.Pipeline.registerFunction(e.jp.stemmer,"stemmer-jp"),e.Pipeline.registerFunction(e.jp.trimmer,"trimmer-jp"),e.Pipeline.registerFunction(e.jp.stopWordFilter,"stopWordFilter-jp")}});

View File

@ -0,0 +1 @@
!function (e, r) { "function" == typeof define && define.amd ? define(r) : "object" == typeof exports ? module.exports = r() : r()(e.lunr) }(this, function () { return function (e) { if (void 0 === e) throw new Error("Lunr is not present. Please include / require Lunr before this script."); if (void 0 === e.stemmerSupport) throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script."); var r = "2" == e.version[0]; e.ja = function () { this.pipeline.reset(), this.pipeline.add(e.ja.trimmer, e.ja.stopWordFilter, e.ja.stemmer), r ? this.tokenizer = e.ja.tokenizer : (e.tokenizer && (e.tokenizer = e.ja.tokenizer), this.tokenizerFn && (this.tokenizerFn = e.ja.tokenizer)) }; var t = new e.TinySegmenter; e.ja.tokenizer = function (i) { var n, o, s, p, a, u, m, l, c, f; if (!arguments.length || null == i || void 0 == i) return []; if (Array.isArray(i)) return i.map(function (t) { return r ? new e.Token(t.toLowerCase()) : t.toLowerCase() }); for (o = i.toString().toLowerCase().replace(/^\s+/, ""), n = o.length - 1; n >= 0; n--)if (/\S/.test(o.charAt(n))) { o = o.substring(0, n + 1); break } for (a = [], s = o.length, c = 0, l = 0; c <= s; c++)if (u = o.charAt(c), m = c - l, u.match(/\s/) || c == s) { if (m > 0) for (p = t.segment(o.slice(l, c)).filter(function (e) { return !!e }), f = l, n = 0; n < p.length; n++)r ? a.push(new e.Token(p[n], { position: [f, p[n].length], index: a.length })) : a.push(p[n]), f += p[n].length; l = c + 1 } return a }, e.ja.stemmer = function () { return function (e) { return e } }(), e.Pipeline.registerFunction(e.ja.stemmer, "stemmer-ja"), e.ja.wordCharacters = "一二三四五六七八九十百千万億兆一-龠々〆ヵヶぁ-んァ-ヴーア-ン゙a-zA-Z--0-9-", e.ja.trimmer = e.trimmerSupport.generateTrimmer(e.ja.wordCharacters), e.Pipeline.registerFunction(e.ja.trimmer, "trimmer-ja"), e.ja.stopWordFilter = e.generateStopWordFilter("これ それ あれ この その あの ここ そこ あそこ こちら どこ だれ なに なん 何 私 貴方 貴方方 我々 私達 あの人 あのかた 彼女 彼 です あります おります います は が の に を で え から まで より も どの と し それで しかし".split(" ")), e.Pipeline.registerFunction(e.ja.stopWordFilter, "stopWordFilter-ja"), e.jp = e.ja, e.Pipeline.registerFunction(e.jp.stemmer, "stemmer-jp"), e.Pipeline.registerFunction(e.jp.trimmer, "trimmer-jp"), e.Pipeline.registerFunction(e.jp.stopWordFilter, "stopWordFilter-jp") } });

6
assets/javascripts/lunr/lunr.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
!function(e,i){"function"==typeof define&&define.amd?define(i):"object"==typeof exports?module.exports=i():i()(e.lunr)}(this,function(){return function(e){e.multiLanguage=function(){for(var i=Array.prototype.slice.call(arguments),t=i.join("-"),r="",n=[],s=[],p=0;p<i.length;++p)"en"==i[p]?(r+="\\w",n.unshift(e.stopWordFilter),n.push(e.stemmer),s.push(e.stemmer)):(r+=e[i[p]].wordCharacters,n.unshift(e[i[p]].stopWordFilter),n.push(e[i[p]].stemmer),s.push(e[i[p]].stemmer));var o=e.trimmerSupport.generateTrimmer(r);return e.Pipeline.registerFunction(o,"lunr-multi-trimmer-"+t),n.unshift(o),function(){this.pipeline.reset(),this.pipeline.add.apply(this.pipeline,n),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add.apply(this.searchPipeline,s))}}}});

18
assets/javascripts/lunr/lunr.no.min.js vendored Normal file
View File

@ -0,0 +1,18 @@
/*!
* Lunr languages, `Norwegian` language
* https://github.com/MihaiValentin/lunr-languages
*
* Copyright 2014, Mihai Valentin
* http://www.mozilla.org/MPL/
*/
/*!
* based on
* Snowball JavaScript Library v0.3
* http://code.google.com/p/urim/
* http://snowball.tartarus.org/
*
* Copyright 2010, Oleg Mazko
* http://www.mozilla.org/MPL/
*/
!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if("undefined"==typeof e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if("undefined"==typeof e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.no=function(){this.pipeline.reset(),this.pipeline.add(e.no.trimmer,e.no.stopWordFilter,e.no.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.no.stemmer))},e.no.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA--",e.no.trimmer=e.trimmerSupport.generateTrimmer(e.no.wordCharacters),e.Pipeline.registerFunction(e.no.trimmer,"trimmer-no"),e.no.stemmer=function(){var r=e.stemmerSupport.Among,n=e.stemmerSupport.SnowballProgram,i=new function(){function e(){var e,r=w.cursor+3;if(a=w.limit,0<=r||r<=w.limit){for(s=r;;){if(e=w.cursor,w.in_grouping(d,97,248)){w.cursor=e;break}if(e>=w.limit)return;w.cursor=e+1}for(;!w.out_grouping(d,97,248);){if(w.cursor>=w.limit)return;w.cursor++}a=w.cursor,a<s&&(a=s)}}function i(){var e,r,n;if(w.cursor>=a&&(r=w.limit_backward,w.limit_backward=a,w.ket=w.cursor,e=w.find_among_b(u,29),w.limit_backward=r,e))switch(w.bra=w.cursor,e){case 1:w.slice_del();break;case 2:n=w.limit-w.cursor,w.in_grouping_b(c,98,122)?w.slice_del():(w.cursor=w.limit-n,w.eq_s_b(1,"k")&&w.out_grouping_b(d,97,248)&&w.slice_del());break;case 3:w.slice_from("er")}}function t(){var e,r=w.limit-w.cursor;w.cursor>=a&&(e=w.limit_backward,w.limit_backward=a,w.ket=w.cursor,w.find_among_b(m,2)?(w.bra=w.cursor,w.limit_backward=e,w.cursor=w.limit-r,w.cursor>w.limit_backward&&(w.cursor--,w.bra=w.cursor,w.slice_del())):w.limit_backward=e)}function o(){var e,r;w.cursor>=a&&(r=w.limit_backward,w.limit_backward=a,w.ket=w.cursor,e=w.find_among_b(l,11),e?(w.bra=w.cursor,w.limit_backward=r,1==e&&w.slice_del()):w.limit_backward=r)}var s,a,u=[new r("a",-1,1),new r("e",-1,1),new r("ede",1,1),new r("ande",1,1),new r("ende",1,1),new r("ane",1,1),new r("ene",1,1),new r("hetene",6,1),new r("erte",1,3),new r("en",-1,1),new r("heten",9,1),new r("ar",-1,1),new r("er",-1,1),new r("heter",12,1),new r("s",-1,2),new r("as",14,1),new r("es",14,1),new r("edes",16,1),new r("endes",16,1),new r("enes",16,1),new r("hetenes",19,1),new r("ens",14,1),new r("hetens",21,1),new r("ers",14,1),new r("ets",14,1),new r("et",-1,1),new r("het",25,1),new r("ert",-1,3),new r("ast",-1,1)],m=[new r("dt",-1,-1),new r("vt",-1,-1)],l=[new r("leg",-1,1),new r("eleg",0,1),new r("ig",-1,1),new r("eig",2,1),new r("lig",2,1),new r("elig",4,1),new r("els",-1,1),new r("lov",-1,1),new r("elov",7,1),new r("slov",7,1),new r("hetslov",9,1)],d=[17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,0,48,0,128],c=[119,125,149,1],w=new n;this.setCurrent=function(e){w.setCurrent(e)},this.getCurrent=function(){return w.getCurrent()},this.stem=function(){var r=w.cursor;return e(),w.limit_backward=r,w.cursor=w.limit,i(),w.cursor=w.limit,t(),w.cursor=w.limit,o(),!0}};return function(e){return"function"==typeof e.update?e.update(function(e){return i.setCurrent(e),i.stem(),i.getCurrent()}):(i.setCurrent(e),i.stem(),i.getCurrent())}}(),e.Pipeline.registerFunction(e.no.stemmer,"stemmer-no"),e.no.stopWordFilter=e.generateStopWordFilter("alle at av bare begge ble blei bli blir blitt både båe da de deg dei deim deira deires dem den denne der dere deres det dette di din disse ditt du dykk dykkar då eg ein eit eitt eller elles en enn er et ett etter for fordi fra før ha hadde han hans har hennar henne hennes her hjå ho hoe honom hoss hossen hun hva hvem hver hvilke hvilken hvis hvor hvordan hvorfor i ikke ikkje ikkje ingen ingi inkje inn inni ja jeg kan kom korleis korso kun kunne kva kvar kvarhelst kven kvi kvifor man mange me med medan meg meget mellom men mi min mine mitt mot mykje ned no noe noen noka noko nokon nokor nokre nå når og også om opp oss over på samme seg selv si si sia sidan siden sin sine sitt sjøl skal skulle slik so som som somme somt så sånn til um upp ut uten var vart varte ved vere verte vi vil ville vore vors vort vår være være vært å".split(" ")),e.Pipeline.registerFunction(e.no.stopWordFilter,"stopWordFilter-no")}});

18
assets/javascripts/lunr/lunr.pt.min.js vendored Normal file

File diff suppressed because one or more lines are too long

18
assets/javascripts/lunr/lunr.ro.min.js vendored Normal file

File diff suppressed because one or more lines are too long

18
assets/javascripts/lunr/lunr.ru.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
!function(r,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():t()(r.lunr)}(this,function(){return function(r){r.stemmerSupport={Among:function(r,t,i,s){if(this.toCharArray=function(r){for(var t=r.length,i=new Array(t),s=0;s<t;s++)i[s]=r.charCodeAt(s);return i},!r&&""!=r||!t&&0!=t||!i)throw"Bad Among initialisation: s:"+r+", substring_i: "+t+", result: "+i;this.s_size=r.length,this.s=this.toCharArray(r),this.substring_i=t,this.result=i,this.method=s},SnowballProgram:function(){var r;return{bra:0,ket:0,limit:0,cursor:0,limit_backward:0,setCurrent:function(t){r=t,this.cursor=0,this.limit=t.length,this.limit_backward=0,this.bra=this.cursor,this.ket=this.limit},getCurrent:function(){var t=r;return r=null,t},in_grouping:function(t,i,s){if(this.cursor<this.limit){var e=r.charCodeAt(this.cursor);if(e<=s&&e>=i&&(e-=i,t[e>>3]&1<<(7&e)))return this.cursor++,!0}return!1},in_grouping_b:function(t,i,s){if(this.cursor>this.limit_backward){var e=r.charCodeAt(this.cursor-1);if(e<=s&&e>=i&&(e-=i,t[e>>3]&1<<(7&e)))return this.cursor--,!0}return!1},out_grouping:function(t,i,s){if(this.cursor<this.limit){var e=r.charCodeAt(this.cursor);if(e>s||e<i)return this.cursor++,!0;if(e-=i,!(t[e>>3]&1<<(7&e)))return this.cursor++,!0}return!1},out_grouping_b:function(t,i,s){if(this.cursor>this.limit_backward){var e=r.charCodeAt(this.cursor-1);if(e>s||e<i)return this.cursor--,!0;if(e-=i,!(t[e>>3]&1<<(7&e)))return this.cursor--,!0}return!1},eq_s:function(t,i){if(this.limit-this.cursor<t)return!1;for(var s=0;s<t;s++)if(r.charCodeAt(this.cursor+s)!=i.charCodeAt(s))return!1;return this.cursor+=t,!0},eq_s_b:function(t,i){if(this.cursor-this.limit_backward<t)return!1;for(var s=0;s<t;s++)if(r.charCodeAt(this.cursor-t+s)!=i.charCodeAt(s))return!1;return this.cursor-=t,!0},find_among:function(t,i){for(var s=0,e=i,n=this.cursor,u=this.limit,o=0,h=0,c=!1;;){for(var a=s+(e-s>>1),f=0,l=o<h?o:h,_=t[a],m=l;m<_.s_size;m++){if(n+l==u){f=-1;break}if(f=r.charCodeAt(n+l)-_.s[m])break;l++}if(f<0?(e=a,h=l):(s=a,o=l),e-s<=1){if(s>0||e==s||c)break;c=!0}}for(;;){var _=t[s];if(o>=_.s_size){if(this.cursor=n+_.s_size,!_.method)return _.result;var b=_.method();if(this.cursor=n+_.s_size,b)return _.result}if(s=_.substring_i,s<0)return 0}},find_among_b:function(t,i){for(var s=0,e=i,n=this.cursor,u=this.limit_backward,o=0,h=0,c=!1;;){for(var a=s+(e-s>>1),f=0,l=o<h?o:h,_=t[a],m=_.s_size-1-l;m>=0;m--){if(n-l==u){f=-1;break}if(f=r.charCodeAt(n-1-l)-_.s[m])break;l++}if(f<0?(e=a,h=l):(s=a,o=l),e-s<=1){if(s>0||e==s||c)break;c=!0}}for(;;){var _=t[s];if(o>=_.s_size){if(this.cursor=n-_.s_size,!_.method)return _.result;var b=_.method();if(this.cursor=n-_.s_size,b)return _.result}if(s=_.substring_i,s<0)return 0}},replace_s:function(t,i,s){var e=s.length-(i-t),n=r.substring(0,t),u=r.substring(i);return r=n+s+u,this.limit+=e,this.cursor>=i?this.cursor+=e:this.cursor>t&&(this.cursor=t),e},slice_check:function(){if(this.bra<0||this.bra>this.ket||this.ket>this.limit||this.limit>r.length)throw"faulty slice operation"},slice_from:function(r){this.slice_check(),this.replace_s(this.bra,this.ket,r)},slice_del:function(){this.slice_from("")},insert:function(r,t,i){var s=this.replace_s(r,t,i);r<=this.bra&&(this.bra+=s),r<=this.ket&&(this.ket+=s)},slice_to:function(){return this.slice_check(),r.substring(this.bra,this.ket)},eq_v_b:function(r){return this.eq_s_b(r.length,r)}}}},r.trimmerSupport={generateTrimmer:function(r){var t=new RegExp("^[^"+r+"]+"),i=new RegExp("[^"+r+"]+$");return function(r){return"function"==typeof r.update?r.update(function(r){return r.replace(t,"").replace(i,"")}):r.replace(t,"").replace(i,"")}}}}});

18
assets/javascripts/lunr/lunr.sv.min.js vendored Normal file
View File

@ -0,0 +1,18 @@
/*!
* Lunr languages, `Swedish` language
* https://github.com/MihaiValentin/lunr-languages
*
* Copyright 2014, Mihai Valentin
* http://www.mozilla.org/MPL/
*/
/*!
* based on
* Snowball JavaScript Library v0.3
* http://code.google.com/p/urim/
* http://snowball.tartarus.org/
*
* Copyright 2010, Oleg Mazko
* http://www.mozilla.org/MPL/
*/
!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if("undefined"==typeof e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if("undefined"==typeof e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.sv=function(){this.pipeline.reset(),this.pipeline.add(e.sv.trimmer,e.sv.stopWordFilter,e.sv.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.sv.stemmer))},e.sv.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA--",e.sv.trimmer=e.trimmerSupport.generateTrimmer(e.sv.wordCharacters),e.Pipeline.registerFunction(e.sv.trimmer,"trimmer-sv"),e.sv.stemmer=function(){var r=e.stemmerSupport.Among,n=e.stemmerSupport.SnowballProgram,t=new function(){function e(){var e,r=w.cursor+3;if(o=w.limit,0<=r||r<=w.limit){for(a=r;;){if(e=w.cursor,w.in_grouping(l,97,246)){w.cursor=e;break}if(w.cursor=e,w.cursor>=w.limit)return;w.cursor++}for(;!w.out_grouping(l,97,246);){if(w.cursor>=w.limit)return;w.cursor++}o=w.cursor,o<a&&(o=a)}}function t(){var e,r=w.limit_backward;if(w.cursor>=o&&(w.limit_backward=o,w.cursor=w.limit,w.ket=w.cursor,e=w.find_among_b(u,37),w.limit_backward=r,e))switch(w.bra=w.cursor,e){case 1:w.slice_del();break;case 2:w.in_grouping_b(d,98,121)&&w.slice_del()}}function i(){var e=w.limit_backward;w.cursor>=o&&(w.limit_backward=o,w.cursor=w.limit,w.find_among_b(c,7)&&(w.cursor=w.limit,w.ket=w.cursor,w.cursor>w.limit_backward&&(w.bra=--w.cursor,w.slice_del())),w.limit_backward=e)}function s(){var e,r;if(w.cursor>=o){if(r=w.limit_backward,w.limit_backward=o,w.cursor=w.limit,w.ket=w.cursor,e=w.find_among_b(m,5))switch(w.bra=w.cursor,e){case 1:w.slice_del();break;case 2:w.slice_from("lös");break;case 3:w.slice_from("full")}w.limit_backward=r}}var a,o,u=[new r("a",-1,1),new r("arna",0,1),new r("erna",0,1),new r("heterna",2,1),new r("orna",0,1),new r("ad",-1,1),new r("e",-1,1),new r("ade",6,1),new r("ande",6,1),new r("arne",6,1),new r("are",6,1),new r("aste",6,1),new r("en",-1,1),new r("anden",12,1),new r("aren",12,1),new r("heten",12,1),new r("ern",-1,1),new r("ar",-1,1),new r("er",-1,1),new r("heter",18,1),new r("or",-1,1),new r("s",-1,2),new r("as",21,1),new r("arnas",22,1),new r("ernas",22,1),new r("ornas",22,1),new r("es",21,1),new r("ades",26,1),new r("andes",26,1),new r("ens",21,1),new r("arens",29,1),new r("hetens",29,1),new r("erns",21,1),new r("at",-1,1),new r("andet",-1,1),new r("het",-1,1),new r("ast",-1,1)],c=[new r("dd",-1,-1),new r("gd",-1,-1),new r("nn",-1,-1),new r("dt",-1,-1),new r("gt",-1,-1),new r("kt",-1,-1),new r("tt",-1,-1)],m=[new r("ig",-1,1),new r("lig",0,1),new r("els",-1,1),new r("fullt",-1,3),new r("löst",-1,2)],l=[17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,0,24,0,32],d=[119,127,149],w=new n;this.setCurrent=function(e){w.setCurrent(e)},this.getCurrent=function(){return w.getCurrent()},this.stem=function(){var r=w.cursor;return e(),w.limit_backward=r,w.cursor=w.limit,t(),w.cursor=w.limit,i(),w.cursor=w.limit,s(),!0}};return function(e){return"function"==typeof e.update?e.update(function(e){return t.setCurrent(e),t.stem(),t.getCurrent()}):(t.setCurrent(e),t.stem(),t.getCurrent())}}(),e.Pipeline.registerFunction(e.sv.stemmer,"stemmer-sv"),e.sv.stopWordFilter=e.generateStopWordFilter("alla allt att av blev bli blir blivit de dem den denna deras dess dessa det detta dig din dina ditt du där då efter ej eller en er era ert ett från för ha hade han hans har henne hennes hon honom hur här i icke ingen inom inte jag ju kan kunde man med mellan men mig min mina mitt mot mycket ni nu när någon något några och om oss på samma sedan sig sin sina sitta själv skulle som så sådan sådana sådant till under upp ut utan vad var vara varför varit varje vars vart vem vi vid vilka vilkas vilken vilket vår våra vårt än är åt över".split(" ")),e.Pipeline.registerFunction(e.sv.stopWordFilter,"stopWordFilter-sv")}});

18
assets/javascripts/lunr/lunr.tr.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -55,3 +55,13 @@ myMenu.addEventListener('click', function() {
toggleClassMenu();
animateMenuItems();
}, false);
// Search toggle
$(".search-toggle").on("click", function() {
$(".search-content").toggleClass("is--visible");
$(".initial-content").toggleClass("is--hidden");
// set focus on input
setTimeout(function() {
$("#search").focus();
}, 400);
});

View File

@ -0,0 +1,27 @@
---
layout: null
sitemap: false
---
var store = [
{%- for c in site.collections -%}
{%- if forloop.last -%}
{%- assign l = true -%}
{%- endif -%}
{%- assign docs = c.docs | where_exp: 'doc', 'doc.search != false' -%}
{%- for doc in docs -%}
{
"title": {{ doc.title | jsonify }},
"excerpt":
{%- if site.search_full_content == true -%}
{{ doc.content | strip_html | strip_newlines | jsonify }},
{%- else -%}
{{ doc.content | strip_html | strip_newlines | truncatewords: 50 | jsonify }},
{%- endif -%}
"categories": {{ doc.categories | jsonify }},
"tags": {{ doc.tags | jsonify }},
"url": {{ doc.url | absolute_url | jsonify }}
} {%- unless forloop.last and l -%}, {%- endunless -%}
{%- endfor -%}
{%- endfor -%}
]

View File

@ -25,6 +25,14 @@ logo: /assets/icons/basically-basic-logo-light.svg
google_analytics: UA-2011187-6
disqus:
shortname: basically-basic-theme
search: true
search_full_content: true
search_provider: lunr
algolia:
application_id: # YOUR_APPLICATION_ID
index_name: # YOUR_INDEX_NAME
search_only_api_key: # YOUR_SEARCH_ONLY_API_KEY
powered_by: # true (default), false
# Conversion
markdown: kramdown

View File

@ -8,6 +8,9 @@ t:
skip_content: "Skip to content"
skip_footer: "Skip to footer"
menu: "Menu"
search: "Search"
results_found: "Result(s) found"
search_placeholder_text: "Enter your search term..."
home: "Home"
newer: "Newer"
older: "Older"

View File

@ -9,6 +9,7 @@ group :jekyll_plugins do
gem "jekyll-seo-tag"
gem "jekyll-sitemap"
gem "jekyll-paginate"
gem "jekyll-algolia"
end
gem "wdm", "~> 0.1.0" if Gem.win_platform?

View File

@ -26,6 +26,14 @@ author:
twitter_username: Towlette_Pettetucci
github_username: Towlette_Pettetucci
logo: /assets/icons/basically-basic-logo-light.svg
search: true
search_full_content: true
search_provider: algolia
algolia:
application_id: QB6HVGBSBA
index_name: basically-basic
search_only_api_key: 9d5014e5bbc77372547bce778dfa5663
powered_by: # true (default), false
# Liquid
liquid: